Răsfoiți Sursa

Merge branch 'feature/animals' of Kolja-Strohm-Games/FactoryCraft-Client into master

Kolja Strohm 1 lună în urmă
părinte
comite
8499737201
59 a modificat fișierele cu 811 adăugiri și 1932 ștergeri
  1. 2 0
      .gitignore
  2. 0 18
      FactoryCraft/AddEntityUpdate.cpp
  3. 0 14
      FactoryCraft/AddEntityUpdate.h
  4. 37 6
      FactoryCraft/Block.cpp
  5. 3 1
      FactoryCraft/Block.h
  6. 5 3
      FactoryCraft/BlockType.cpp
  7. 2 2
      FactoryCraft/BlockType.h
  8. 2 2
      FactoryCraft/Chunk.cpp
  9. 20 18
      FactoryCraft/ChunkFluidModel.cpp
  10. 6 8
      FactoryCraft/ChunkGroundModel.cpp
  11. 1 1
      FactoryCraft/Constants.h
  12. 63 51
      FactoryCraft/CraftingGrid.cpp
  13. 4 2
      FactoryCraft/CraftingGrid.h
  14. 0 775
      FactoryCraft/CustomUIDX11PixelShader.h
  15. 0 735
      FactoryCraft/CustomUIDX11VertexShader.h
  16. 2 0
      FactoryCraft/DX11CustomPixelShader.hlsl
  17. 1 1
      FactoryCraft/DX11CustomVertexShader.hlsl
  18. 10 1
      FactoryCraft/Dialog.cpp
  19. 14 0
      FactoryCraft/Dimension.cpp
  20. 1 1
      FactoryCraft/Entity.cpp
  21. 0 14
      FactoryCraft/EntityRemovedUpdate.cpp
  22. 0 14
      FactoryCraft/EntityRemovedUpdate.h
  23. 0 1
      FactoryCraft/EntityType.cpp
  24. 34 0
      FactoryCraft/FactoryClient.cpp
  25. 2 0
      FactoryCraft/FactoryClient.h
  26. 12 11
      FactoryCraft/FactoryCraft.vcxproj
  27. 33 30
      FactoryCraft/FactoryCraft.vcxproj.filters
  28. 14 4
      FactoryCraft/FactoryCraftModel.cpp
  29. 2 0
      FactoryCraft/FactoryCraftModel.h
  30. 6 1
      FactoryCraft/Game.cpp
  31. 1 0
      FactoryCraft/Globals.h
  32. 14 9
      FactoryCraft/InventoryView.cpp
  33. 9 6
      FactoryCraft/ItemBar.cpp
  34. 0 2
      FactoryCraft/ItemType.cpp
  35. 21 0
      FactoryCraft/NetworkAPIProcessor.cpp
  36. 12 1
      FactoryCraft/NetworkAPIProcessor.h
  37. 0 18
      FactoryCraft/Registries.h
  38. 17 17
      FactoryCraft/ServerSelection.cpp
  39. 0 16
      FactoryCraft/StaticInitializerOrder.cpp
  40. 0 66
      FactoryCraft/StaticRegistry.h
  41. 7 4
      FactoryCraft/StatusBars.cpp
  42. 7 6
      FactoryCraft/TransparentChunkGroundModel.cpp
  43. 53 0
      FactoryCraft/UIMLCraftingProgress.cpp
  44. 19 0
      FactoryCraft/UIMLCraftingProgress.h
  45. 51 0
      FactoryCraft/UIMLFuelState.cpp
  46. 17 0
      FactoryCraft/UIMLFuelState.h
  47. 164 0
      FactoryCraft/UIMLProgressAndStateView.cpp
  48. 45 0
      FactoryCraft/UIMLProgressAndStateView.h
  49. 66 0
      FactoryCraft/UIMLUtils.cpp
  50. 5 0
      FactoryCraft/UIMLUtils.h
  51. 27 26
      FactoryCraft/World.cpp
  52. 0 28
      FactoryCraft/WorldUpdate.cpp
  53. 0 19
      FactoryCraft/WorldUpdate.h
  54. BIN
      FactoryCraft/data_release/bilder/gui_icons.ltdb
  55. BIN
      FactoryCraft/data_release/models/items.m3
  56. BIN
      FactoryCraft/data_release/models/plants.m3
  57. BIN
      FactoryCraft/data_release/textures/items.ltdb
  58. BIN
      FactoryCraft/data_release/textures/plants.ltdb
  59. BIN
      FactoryCraft/error_core_memory_dump.dmp

+ 2 - 0
.gitignore

@@ -265,3 +265,5 @@ Framework.dll
 Network.dll
 KSGClient/Netzwerk/Keys.cpp
 /enc_temp_folder
+/FactoryCraft/CustomUIDX11PixelShader.h
+/FactoryCraft/CustomUIDX11VertexShader.h

+ 0 - 18
FactoryCraft/AddEntityUpdate.cpp

@@ -1,18 +0,0 @@
-#include "AddEntityUpdate.h"
-
-#include "Entity.h"
-#include "Globals.h"
-#include "Registries.h"
-#include "StaticRegistry.h"
-
-AddEntityUpdateType::AddEntityUpdateType()
-    : WorldUpdateType(ID)
-{}
-
-void AddEntityUpdateType::applyUpdate(Framework::StreamReader* zReader)
-{
-    int type;
-    zReader->lese((char*)&type, 4);
-    Entity* entity = entityTypes[type]->loadEntity(zReader);
-    World::INSTANCE->zDimension()->addEntity(entity);
-}

+ 0 - 14
FactoryCraft/AddEntityUpdate.h

@@ -1,14 +0,0 @@
-#pragma once
-
-#include "WorldUpdate.h"
-
-class AddEntityUpdateType : public WorldUpdateType
-{
-    REGISTRABLE(AddEntityUpdateType)
-
-protected:
-    AddEntityUpdateType();
-    void applyUpdate(Framework::StreamReader* zReader) override;
-};
-
-REGISTER(AddEntityUpdateType, WorldUpdateType)

+ 37 - 6
FactoryCraft/Block.cpp

@@ -25,7 +25,8 @@ Block::Block(const BlockType* zType,
       flowOptions(0),
       distanceToSource(0),
       passable(passable),
-      speedModifier(speedModifier)
+      speedModifier(speedModifier),
+      currentModelInfo(0)
 {
     hp = (float)maxHP;
     memset(sideVisible, 0, 6);
@@ -38,7 +39,13 @@ Block::Block(const BlockType* zType,
     setSize(size);
 }
 
-Block::~Block() {}
+Block::~Block()
+{
+    if (currentModelInfo)
+    {
+        delete currentModelInfo;
+    }
+}
 
 void Block::beforeRender(
     GraphicsApi* api, Shader* zVertexShader, Shader* zPixelShader)
@@ -79,17 +86,22 @@ void Block::api(char* message)
         }
     case 1: // model change
         {
+            ModelInfo* old = currentModelInfo;
             ByteArrayReader reader(message + 1, 10000, 0);
-            ModelInfo info(&reader);
-            setModelDaten(info.getModel());
-            setSize(info.getSize());
-            setModelTextur(info.getTexture());
+            currentModelInfo = new ModelInfo(&reader);
+            setModelDaten(currentModelInfo->getModel());
+            setSize(currentModelInfo->getSize());
+            setModelTextur(currentModelInfo->getTexture());
             Chunk* zChunk = World::INSTANCE->zChunk(
                 World::INSTANCE->getChunkCenter(location.x, location.y));
             if (zChunk)
             {
                 zChunk->setModelChanged(partOfModel);
             }
+            if (old)
+            {
+                delete old;
+            }
             break;
         }
     case 2: // update fluid state
@@ -126,6 +138,20 @@ void Block::setLightData(Direction dir, unsigned char* data, Chunk* zC)
     else
         sideVisible[getDirectionIndex(dir)] = 0;
     if (zC) zC->setLightChanged(partOfModel);
+    int sum1 = 0;
+    int sum2 = 0;
+    int sum3 = 0;
+    for (int i = 0; i < 6; i++)
+    {
+        sum1 += *(lightData + i * 6 + 3);
+        sum2 += *(lightData + i * 6 + 4);
+        sum3 += *(lightData + i * 6 + 5);
+    }
+    unsigned char average[3];
+    average[0] = (unsigned char)(sum1 / 6);
+    average[1] = (unsigned char)(sum2 / 6);
+    average[2] = (unsigned char)(sum3 / 6);
+    setAverageLight(average);
 }
 
 void Block::setPartOfModel(int type, bool part)
@@ -277,3 +303,8 @@ char Block::getDistanceToSource() const
 {
     return distanceToSource;
 }
+
+const ModelInfo& Block::getCurrentModelInfo() const
+{
+    return currentModelInfo ? *currentModelInfo : zType->getModelInfo();
+}

+ 3 - 1
FactoryCraft/Block.h

@@ -5,7 +5,7 @@
 #include "Area.h"
 #include "BlockType.h"
 #include "FactoryCraftModel.h"
-#include "Registries.h"
+#include "ModelInfo.h"
 
 using namespace Framework;
 
@@ -27,6 +27,7 @@ protected:
     char distanceToSource;
     bool passable;
     float speedModifier;
+    ModelInfo* currentModelInfo;
 
     void beforeRender(
         GraphicsApi* api, Shader* zVertexShader, Shader* zPixelShader) override;
@@ -60,6 +61,7 @@ public:
     int getPartOfModels() const;
     char getFlowOptions() const;
     char getDistanceToSource() const;
+    const ModelInfo& getCurrentModelInfo() const;
 
     friend Chunk;
 };

+ 5 - 3
FactoryCraft/BlockType.cpp

@@ -1,7 +1,6 @@
 #include "BlockType.h"
 
 #include "Block.h"
-#include "Registries.h"
 
 using namespace Framework;
 
@@ -24,7 +23,8 @@ BlockType::BlockType(int id,
 
 BlockType::~BlockType() {}
 
-Block* BlockType::createBlock(Framework::Vec3<int> position, bool passable, float speedModifier)
+Block* BlockType::createBlock(
+    Framework::Vec3<int> position, bool passable, float speedModifier)
 {
     return new Block(this,
         position,
@@ -33,7 +33,9 @@ Block* BlockType::createBlock(Framework::Vec3<int> position, bool passable, floa
         initialMaxHP,
         model.isTransparent(),
         needModelSubscription,
-        model.getSize(), passable, speedModifier);
+        model.getSize(),
+        passable,
+        speedModifier);
 }
 
 int BlockType::getId() const

+ 2 - 2
FactoryCraft/BlockType.h

@@ -5,7 +5,6 @@
 #include <Vec3.h>
 
 #include "ModelInfo.h"
-#include "StaticRegistry.h"
 
 class Block;
 
@@ -29,7 +28,8 @@ public:
         bool fluid,
         char maxFlowDistance);
     ~BlockType();
-    Block* createBlock(Framework::Vec3<int> position, bool passable, float speedModifier);
+    Block* createBlock(
+        Framework::Vec3<int> position, bool passable, float speedModifier);
     bool doesNeedInstance() const;
     bool doesNeedModelSubscription() const;
     bool isFluid() const;

+ 2 - 2
FactoryCraft/Chunk.cpp

@@ -8,14 +8,14 @@
 #include "CustomDX11API.h"
 #include "FactoryCraftModel.h"
 #include "Globals.h"
-#include "Registries.h"
 #include "TransparentChunkGroundModel.h"
 
 Chunk::Chunk(Framework::Punkt location)
     : ReferenceCounter(),
       location(location),
       isLoading(0),
-      lightChanged(0)
+      lightChanged(0),
+      modelChanged(0)
 {
     blocks = new Block*[CHUNK_SIZE * CHUNK_SIZE * WORLD_HEIGHT];
     memset(blocks, 0, CHUNK_SIZE * CHUNK_SIZE * WORLD_HEIGHT * sizeof(Block*));

+ 20 - 18
FactoryCraft/ChunkFluidModel.cpp

@@ -135,20 +135,19 @@ void ChunkFluidModel::buildModel()
                 setBlockPartOfModel(blocks()[i], 1);
                 int index = 0;
                 for (Text* textureName :
-                    *blocks()[i]->zBlockType()->getModelInfo().getTexturNames())
+                    *blocks()[i]->getCurrentModelInfo().getTexturNames())
                 {
                     Framework::Vec3<int> location(
                         (i / WORLD_HEIGHT) / CHUNK_SIZE,
                         (i / WORLD_HEIGHT) % CHUNK_SIZE,
                         i % WORLD_HEIGHT);
                     Framework::Vec3<int> aboveLocation
-                        = location
-                        + getDirection(Direction::TOP);
+                        = location + getDirection(Direction::TOP);
                     int aboveIndex = Chunk::index(aboveLocation);
                     bool sameAbove = aboveLocation.z < WORLD_HEIGHT
-						&& blocks()[aboveIndex]
-						&& blocks()[aboveIndex]->zBlockType()
-							   == blocks()[i]->zBlockType();
+                                  && blocks()[aboveIndex]
+                                  && blocks()[aboveIndex]->zBlockType()
+                                         == blocks()[i]->zBlockType();
                     if (isPartOfGroundModel(location, index))
                     {
                         if (!groundModelBuidler.get(
@@ -212,16 +211,19 @@ void ChunkFluidModel::buildModel()
                                 char maxFlowDist = blocks()[i]
                                                        ->zBlockType()
                                                        ->getMaxFlowDistance();
-                                float dist = (float)(maxFlowDist + 1 - blocks()[i]
-                                                    ->getDistanceToSource()) / (float)(maxFlowDist + 1);
+                                float dist
+                                    = (float)(maxFlowDist + 1
+                                              - blocks()[i]
+                                                  ->getDistanceToSource())
+                                    / (float)(maxFlowDist + 1);
                                 groundVerticies[groundVertexCount - 1].pos.z
                                     -= (1 - dist);
                             }
                             groundVerticies[groundVertexCount - 1].pos
                                 += blocks()[i]->getPos()
-                                    - Vec3<float>((float)chunkCenter().x,
-                                        (float)chunkCenter().y,
-                                        (float)WORLD_HEIGHT / 2.f);
+                                 - Vec3<float>((float)chunkCenter().x,
+                                     (float)chunkCenter().y,
+                                     (float)WORLD_HEIGHT / 2.f);
                             groundVerticies[groundVertexCount - 1].id
                                 = groundVertexCount - 1;
                         }
@@ -261,15 +263,13 @@ bool ChunkFluidModel::updateLightning()
     int groundVertexCount = 0;
     for (int i = 0; i < CHUNK_SIZE * CHUNK_SIZE * WORLD_HEIGHT; i++)
     {
-        if (blocks()[i]
-            && isPartOfModel(blocks()[i]))
+        if (blocks()[i] && isPartOfModel(blocks()[i]))
         {
             int index = 0;
             for (Text* textureName :
-                *blocks()[i]->zBlockType()->getModelInfo().getTexturNames())
+                *blocks()[i]->getCurrentModelInfo().getTexturNames())
             {
-                Framework::Vec3<int> location(
-                    (i / WORLD_HEIGHT) / CHUNK_SIZE,
+                Framework::Vec3<int> location((i / WORLD_HEIGHT) / CHUNK_SIZE,
                     (i / WORLD_HEIGHT) % CHUNK_SIZE,
                     i % WORLD_HEIGHT);
                 if (isPartOfGroundModel(location, index))
@@ -282,9 +282,11 @@ bool ChunkFluidModel::updateLightning()
                     {
                         if (oldVertexCount <= groundVertexCount)
                         {
-                            std::cout << "ERROR: to many vertecies in chunk fluid model" << std::endl;
+                            std::cout << "ERROR: to many vertecies in chunk "
+                                         "fluid model"
+                                      << std::endl;
                             return 0;
-						}
+                        }
                         lightBuffer[groundVertexCount++] = calculateLight(
                             vBuffer[polygon->indexList[vi]].pos,
                             location,

+ 6 - 8
FactoryCraft/ChunkGroundModel.cpp

@@ -102,10 +102,9 @@ bool ChunkGroundModel::isPartOfGroundModel(
         int naighborIndex = Chunk::index(neighborLocation);
         if (!blocks()[naighborIndex]
             || !blocks()[naighborIndex]
-                    ->zBlockType()
-                    ->getModelInfo()
-                    .getModelName()
-                    .istGleich("cube"))
+                ->getCurrentModelInfo()
+                .getModelName()
+                .istGleich("cube"))
         {
             needed = 1;
         }
@@ -137,7 +136,7 @@ void ChunkGroundModel::buildModel()
                 setBlockPartOfModel(blocks()[i], 1);
                 int index = 0;
                 for (Text* textureName :
-                    *blocks()[i]->zBlockType()->getModelInfo().getTexturNames())
+                    *blocks()[i]->getCurrentModelInfo().getTexturNames())
                 {
                     Framework::Vec3<int> location(
                         (i / WORLD_HEIGHT) / CHUNK_SIZE,
@@ -249,7 +248,7 @@ bool ChunkGroundModel::updateLightning()
             {
                 int index = 0;
                 for (Text* textureName :
-                    *blocks()[i]->zBlockType()->getModelInfo().getTexturNames())
+                    *blocks()[i]->getCurrentModelInfo().getTexturNames())
                 {
                     Framework::Vec3<int> location(
                         (i / WORLD_HEIGHT) / CHUNK_SIZE,
@@ -285,6 +284,5 @@ bool ChunkGroundModel::isTransparent() const
 
 bool ChunkGroundModel::isPartOfModel(Block* zBlock) const
 {
-    return zBlock->zBlockType()->getModelInfo().getModelName().istGleich(
-        "cube");
+    return zBlock->getCurrentModelInfo().getModelName().istGleich("cube");
 }

+ 1 - 1
FactoryCraft/Constants.h

@@ -5,6 +5,6 @@
 #ifdef _DEBUG
 #    define CHUNK_VISIBILITY_RANGE 2
 #else
-#    define CHUNK_VISIBILITY_RANGE 64
+#    define CHUNK_VISIBILITY_RANGE 32
 #endif
 #define MAX_VIEW_DISTANCE CHUNK_SIZE* CHUNK_VISIBILITY_RANGE

+ 63 - 51
FactoryCraft/CraftingGrid.cpp

@@ -7,6 +7,7 @@
 #include "Game.h"
 #include "Globals.h"
 #include "UIMLToolTip.h"
+#include "UIMLUtils.h"
 
 using namespace Framework;
 
@@ -26,31 +27,14 @@ Framework::Zeichnung* CraftingGridElement::parseElement(
 {
     Text targetValue = element.getAttributeValue("target");
     Vec3<int> blockPos(0, 0, 0);
-    Framework::Either<int, VecN<int, 4>> target((int)targetValue);
-    if (targetValue.hat(','))
-    {
-        Text* first
-            = targetValue.getTeilText(0, targetValue.positionVon(",", 0) + 1);
-        Text* second
-            = targetValue.getTeilText(targetValue.positionVon(",", 0) + 1,
-                targetValue.positionVon(",", 1));
-        Text* third
-            = targetValue.getTeilText(targetValue.positionVon(",", 1) + 1,
-                targetValue.positionVon(",", 2));
-        Text* forth
-            = targetValue.getTeilText(targetValue.positionVon(",", 2) + 1);
-        target = Framework::Either<int, VecN<int, 4>>(VecN<int, 4>(
-            {(int)*first, (int)*second, (int)*third, (int)*forth}));
-        first->release();
-        second->release();
-        third->release();
-        forth->release();
-    }
+    int addressLength = 0;
+    int* address = getUIMLTargetAddress(targetValue, addressLength);
     return new CraftingGridView(element.getAttributeValue("id"),
         (int)element.getAttributeValue("rowSize"),
         (int)element.getAttributeValue("colSize"),
         (int)element.getAttributeValue("numOutputSlots"),
-        target);
+        address,
+        addressLength);
 }
 
 bool CraftingGridElement::updateElement(Framework::XML::Element& element,
@@ -75,12 +59,15 @@ CraftingGridView::CraftingGridView(Text id,
     int rowSize,
     int colSize,
     int numOutputSlots,
-    Either<int, VecN<int, 4>> target)
+    int* address,
+    int addressLength)
     : ZeichnungHintergrund(),
+      NetworkAPIProcessor(),
       rowSize(rowSize),
       colSize(colSize),
       numOutputSlots(numOutputSlots),
-      target(target),
+      address(address),
+      addressLength(addressLength),
       slots(0),
       outputs(0),
       id(id),
@@ -96,20 +83,16 @@ CraftingGridView::CraftingGridView(Text id,
     craft->setMausEreignis([this](void* p, void* o, MausEreignis me) {
         if (me.id == ME_RLinks)
         {
-            char* msg = new char[2 + (this->target.isA() ? 4 : 16)];
+            char* msg = new char[2 + 4 * this->addressLength];
             msg[0] = 7; // request crafting
-            msg[1] = (char)this->target.isA();
-            if (msg[1])
-                *(int*)(msg + 2) = this->target.getA();
-            else
+            msg[1] = this->addressLength < 4;
+            for (int i = 0; i < this->addressLength; i++)
             {
-                *(int*)(msg + 2) = this->target.getB()[0];
-                *(int*)(msg + 6) = this->target.getB()[1];
-                *(int*)(msg + 10) = this->target.getB()[2];
-                *(int*)(msg + 14) = this->target.getB()[3];
+                *(int*)(msg + 2 + i * 4)
+                    = this->address[i]; // copy address to message
             }
             World::INSTANCE->zClient()->sendPlayerAction(
-                msg, 2 + (this->target.isA() ? 4 : 16));
+                msg, 2 + 4 * this->addressLength);
             delete[] msg;
         }
         return 1;
@@ -137,14 +120,21 @@ CraftingGridView::CraftingGridView(Text id,
         uiFactory.initParam.schrift);
     setStyle(ZeichnungHintergrund::Style::Sichtbar
              | ZeichnungHintergrund::Style::Erlaubt);
-    char* msg = new char[id.getLength() + 12 + 3];
+    char* msg = new char[id.getLength() + 12 + 3 + 4];
     msg[0] = 0; // request inventory tooltip
     msg[1] = (char)id.getLength();
     memcpy(msg + 2, id.getText(), id.getLength());
-    msg[2 + id.getLength()] = (char)12;
-    memcpy(msg + 3 + id.getLength(), "CraftingGrid", 12);
+    *(int*)(msg + 2 + id.getLength()) = NetworkAPIProcessor::getId();
+    msg[6 + id.getLength()] = (char)12;
+    memcpy(msg + 7 + id.getLength(), "CraftingGrid", 12);
     World::INSTANCE->zClient()->inventoryAPIRequest(
-        target, msg, id.getLength() + 12 + 3);
+        addressLength < 4
+            ? Framework::Either<int, Framework::VecN<int, 4>>(address[0])
+            : Framework::Either<int, Framework::VecN<int, 4>>(
+                  Framework::VecN<int, 4>{
+                      address[0], address[1], address[2], address[3]}),
+        msg,
+        id.getLength() + 12 + 3 + 4);
     delete[] msg;
     setNeedToolTipEvent([this](Zeichnung* z, Punkt p) {
         int slot = getSlotByLocalPos(p);
@@ -158,13 +148,24 @@ CraftingGridView::CraftingGridView(Text id,
         {
             std::cout << "requesting tooltip for slot " << slot << "\n";
             requestetTooltipSlot = slot;
-            char* msg = new char[this->id.getLength() + 6];
+            char* msg = new char[this->id.getLength() + 10];
             msg[0] = 2; // request inventory tooltip
             msg[1] = (char)this->id.getLength();
             memcpy(msg + 2, this->id.getText(), this->id.getLength());
-            *(int*)(msg + 2 + this->id.getLength()) = slot;
+            *(int*)(msg + 2 + this->id.getLength())
+                = NetworkAPIProcessor::getId();
+            *(int*)(msg + 6 + this->id.getLength()) = slot;
             World::INSTANCE->zClient()->inventoryAPIRequest(
-                this->target, msg, this->id.getLength() + 6);
+                this->addressLength < 4
+                    ? Framework::Either<int, Framework::VecN<int, 4>>(
+                          this->address[0])
+                    : Framework::Either<int, Framework::VecN<int, 4>>(
+                          Framework::VecN<int, 4>{this->address[0],
+                              this->address[1],
+                              this->address[2],
+                              this->address[3]}),
+                msg,
+                this->id.getLength() + 10);
             return 1;
         }
         return 0;
@@ -178,12 +179,19 @@ CraftingGridView::~CraftingGridView()
     if (controller->getCurrentDragContainer() == this) controller->stopDrag();
     if (slots) slots->release();
     if (outputs) outputs->release();
-    char* msg = new char[id.getLength() + 2];
+    char* msg = new char[id.getLength() + 6];
     msg[0] = 1;
     msg[1] = (char)id.getLength();
     memcpy(msg + 2, id.getText(), id.getLength());
+    *(int*)(msg + 2 + id.getLength()) = NetworkAPIProcessor::getId();
     World::INSTANCE->zClient()->inventoryAPIRequest(
-        target, msg, id.getLength() + 2);
+        addressLength < 4
+            ? Framework::Either<int, Framework::VecN<int, 4>>(address[0])
+            : Framework::Either<int, Framework::VecN<int, 4>>(
+                  Framework::VecN<int, 4>{
+                      address[0], address[1], address[2], address[3]}),
+        msg,
+        id.getLength() + 6);
     delete[] msg;
     craft->release();
     recipies->release();
@@ -472,7 +480,7 @@ void CraftingGridView::doMausEreignis(MausEreignis& me, bool userRet)
                         = controller->getCurrentDragContainer()
                               ->getInventoryTarget();
                     int len = 2 + (source.isA() ? 4 : 16) + 5
-                            + (target.isA() ? 4 : 16) + 4;
+                            + (addressLength < 4 ? 4 : 16) + 4;
                     char* msg = new char[len];
                     int index = 0;
                     msg[index++] = 6;
@@ -492,18 +500,18 @@ void CraftingGridView::doMausEreignis(MausEreignis& me, bool userRet)
                     }
                     *(int*)(msg + index) = controller->getCurrentDaragElement();
                     index += 4;
-                    msg[index++] = target.isA();
-                    if (target.isA())
+                    msg[index++] = addressLength < 4;
+                    if (addressLength < 4)
                     {
-                        *(int*)(msg + index) = target.getA();
+                        *(int*)(msg + index) = address[0];
                         index += 4;
                     }
                     else
                     {
-                        *(int*)(msg + index) = target.getB()[0];
-                        *(int*)(msg + index + 4) = target.getB()[1];
-                        *(int*)(msg + index + 8) = target.getB()[2];
-                        *(int*)(msg + index + 12) = target.getB()[3];
+                        *(int*)(msg + index) = address[0];
+                        *(int*)(msg + index + 4) = address[1];
+                        *(int*)(msg + index + 8) = address[2];
+                        *(int*)(msg + index + 12) = address[3];
                         index += 16;
                     }
                     *(int*)(msg + index) = info.id;
@@ -537,5 +545,9 @@ void CraftingGridView::doMausEreignis(MausEreignis& me, bool userRet)
 Framework::Either<int, Framework::VecN<int, 4>>
 CraftingGridView::getInventoryTarget() const
 {
-    return target;
+    return addressLength < 4
+             ? Framework::Either<int, Framework::VecN<int, 4>>(address[0])
+             : Framework::Either<int, Framework::VecN<int, 4>>(
+                   Framework::VecN<int, 4>{
+                       address[0], address[1], address[2], address[3]});
 }

+ 4 - 2
FactoryCraft/CraftingGrid.h

@@ -37,7 +37,8 @@ private:
     int colSize;
     int numOutputSlots;
     // entity id or block position
-    Framework::Either<int, Framework::VecN<int, 4>> target;
+    int* address;
+    int addressLength;
     Framework::Array<SlotInfo>* slots;
     Framework::Array<SlotInfo>* outputs;
     Framework::Text id;
@@ -55,7 +56,8 @@ public:
         int rowSize,
         int colSize,
         int numOutputSlots,
-        Framework::Either<int, Framework::VecN<int, 4>> target);
+        int* address,
+        int addressLength);
     ~CraftingGridView();
     void api(char* message) override;
     bool tick(double tickVal) override;

+ 0 - 775
FactoryCraft/CustomUIDX11PixelShader.h

@@ -1,775 +0,0 @@
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer Material
-// {
-//
-//   float ambientFactor;               // Offset:    0 Size:     4
-//   float diffusFactor;                // Offset:    4 Size:     4
-//   float specularFactor;              // Offset:    8 Size:     4 [unused]
-//
-// }
-//
-// cbuffer LightCount
-// {
-//
-//   int diffuseLightCount;             // Offset:    0 Size:     4
-//   int pointLightCount;               // Offset:    4 Size:     4 [unused]
-//
-// }
-//
-// cbuffer TexturEffect
-// {
-//
-//   bool effectEnabled;                // Offset:    0 Size:     4
-//   float effectPercentage;            // Offset:    4 Size:     4
-//
-// }
-//
-// Resource bind info for difuseLights
-// {
-//
-//   struct DiffuseLight
-//   {
-//       
-//       float3 direction;              // Offset:    0
-//       float3 color;                  // Offset:   12
-//
-//   } $Element;                        // Offset:    0 Size:    24
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// SampleType                        sampler      NA          NA             s0      1 
-// shaderTexture                     texture  float4          2d             t0      1 
-// difuseLights                      texture  struct         r/o             t1      1 
-// additionalTexture                 texture  float4          2d             t3      1 
-// Material                          cbuffer      NA          NA            cb1      1 
-// LightCount                        cbuffer      NA          NA            cb2      1 
-// TexturEffect                      cbuffer      NA          NA            cb3      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// POSITION                 0   xyzw        0     NONE   float       
-// SV_POSITION              0   xyzw        1      POS   float       
-// TEXCOORD                 0   xy          2     NONE   float   xy  
-// TEXCOORD                 1   xyz         3     NONE   float   xyz 
-// TEXCOORD                 2   xyzw        4     NONE   float   xyzw
-// TEXCOORD                 3   xyzw        5     NONE   float   xyz 
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
-//
-ps_5_0
-dcl_globalFlags refactoringAllowed
-dcl_constantbuffer CB1[1], immediateIndexed
-dcl_constantbuffer CB2[1], immediateIndexed
-dcl_constantbuffer CB3[1], immediateIndexed
-dcl_sampler s0, mode_default
-dcl_resource_texture2d (float,float,float,float) t0
-dcl_resource_structured t1, 24
-dcl_resource_texture2d (float,float,float,float) t3
-dcl_input_ps linear v2.xy
-dcl_input_ps linear v3.xyz
-dcl_input_ps linear v4.xyzw
-dcl_input_ps linear v5.xyz
-dcl_output o0.xyzw
-dcl_temps 4
-sample_indexable(texture2d)(float,float,float,float) r0.xyzw, v2.xyxx, t0.xyzw, s0
-if_nz cb3[0].x
-  lt r1.x, l(1.000000), cb3[0].y
-  add r1.y, cb3[0].y, l(-1.000000)
-  movc r1.y, r1.x, r1.y, cb3[0].y
-  not r1.z, r1.x
-  add r1.w, r0.w, l(-0.250000)
-  lt r1.w, r1.w, l(0.000000)
-  and r1.z, r1.z, r1.w
-  discard_nz r1.z
-  add r1.zw, v2.xxxy, l(0.000000, 0.000000, -0.500000, -0.500000)
-  mul r1.zw, r1.zzzw, r1.zzzw
-  add r1.z, r1.w, r1.z
-  sqrt r1.z, r1.z
-  mul r1.w, r1.z, l(1.414214)
-  lt r1.w, r1.w, r1.y
-  if_nz r1.w
-    mad r1.y, -r1.z, l(1.414214), r1.y
-    mul r1.z, r1.y, l(5.000000)
-    lt r1.y, l(0.200000), r1.y
-    movc r1.y, r1.y, l(1.000000), r1.z
-    sample_indexable(texture2d)(float,float,float,float) r2.xyzw, v2.xyxx, t3.xyzw, s0
-    mul r1.z, r1.y, r2.w
-    mad r1.y, -r2.w, r1.y, l(1.000000)
-    mul r3.xyzw, r0.xyzw, r1.yyyy
-    mad r0.xyzw, r2.xyzw, r1.zzzz, r3.xyzw
-    lt r1.y, l(1.000000), r1.z
-    movc r1.y, r1.y, l(1.000000), r1.z
-    movc r0.w, r1.x, r1.y, r0.w
-  endif 
-else 
-  add r1.x, r0.w, l(-0.250000)
-  lt r1.x, r1.x, l(0.000000)
-  discard_nz r1.x
-endif 
-lt r1.x, l(0.000000), v4.w
-if_nz r1.x
-  mul r1.xyz, r0.xyzx, v4.xyzx
-  mul r2.xyz, r0.xyzx, v5.xyzx
-  ilt r1.w, l(0), cb2[0].x
-  ld_structured_indexable(structured_buffer, stride=24)(mixed,mixed,mixed,mixed) r3.xyz, l(0), l(0), t1.xyzx
-  dp3 r2.w, v3.xyzx, -r3.xyzx
-  lt r3.x, r2.w, l(0.000000)
-  mad r2.w, r2.w, l(0.500000), l(0.500000)
-  movc r2.w, r3.x, l(0.500000), r2.w
-  mul r3.xyz, r1.xyzx, r2.wwww
-  mul r1.xyz, r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
-  movc r1.xyz, r1.wwww, r3.xyzx, r1.xyzx
-  lt r3.xyz, r1.xyzx, r2.xyzx
-  movc r1.xyz, r3.xyzx, r2.xyzx, r1.xyzx
-else 
-  mov r1.xyz, l(1.000000,1.000000,1.000000,0)
-endif 
-mul r1.xyz, r1.xyzx, cb1[0].yyyy
-mad_sat r0.xyz, r0.xyzx, cb1[0].xxxx, r1.xyzx
-ne r1.x, r1.x, r1.x
-discard_nz r1.x
-ine r1.x, cb3[0].x, l(0)
-eq r1.y, cb3[0].y, l(0.000000)
-and r1.x, r1.y, r1.x
-add r1.y, r0.w, l(-0.500000)
-lt r1.y, r1.y, l(0.000000)
-and r1.x, r1.x, r1.y
-discard_nz r1.x
-mov o0.xyzw, r0.xyzw
-ret 
-// Approximately 66 instruction slots used
-#endif
-
-const BYTE CustomUIDX11PixelShader[] =
-{
-     68,  88,  66,  67,  27, 249, 
-     78, 103, 114, 173,  15, 185, 
-    255, 255, 211,  50, 126, 210, 
-     31,  15,   1,   0,   0,   0, 
-     72,  14,   0,   0,   5,   0, 
-      0,   0,  52,   0,   0,   0, 
-    248,   4,   0,   0, 184,   5, 
-      0,   0, 236,   5,   0,   0, 
-    172,  13,   0,   0,  82,  68, 
-     69,  70, 188,   4,   0,   0, 
-      4,   0,   0,   0, 120,   1, 
-      0,   0,   7,   0,   0,   0, 
-     60,   0,   0,   0,   0,   5, 
-    255, 255,   0,   1,   0,   0, 
-    148,   4,   0,   0,  82,  68, 
-     49,  49,  60,   0,   0,   0, 
-     24,   0,   0,   0,  32,   0, 
-      0,   0,  40,   0,   0,   0, 
-     36,   0,   0,   0,  12,   0, 
-      0,   0,   0,   0,   0,   0, 
-     28,   1,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,  39,   1,   0,   0, 
-      2,   0,   0,   0,   5,   0, 
-      0,   0,   4,   0,   0,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-     13,   0,   0,   0,  53,   1, 
-      0,   0,   5,   0,   0,   0, 
-      6,   0,   0,   0,   1,   0, 
-      0,   0,  24,   0,   0,   0, 
-      1,   0,   0,   0,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-     66,   1,   0,   0,   2,   0, 
-      0,   0,   5,   0,   0,   0, 
-      4,   0,   0,   0, 255, 255, 
-    255, 255,   3,   0,   0,   0, 
-      1,   0,   0,   0,  13,   0, 
-      0,   0,  84,   1,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-      1,   0,   0,   0,  93,   1, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      2,   0,   0,   0,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-    104,   1,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      1,   0,   0,   0,   1,   0, 
-      0,   0,  83,  97, 109, 112, 
-    108, 101,  84, 121, 112, 101, 
-      0, 115, 104,  97, 100, 101, 
-    114,  84, 101, 120, 116, 117, 
-    114, 101,   0, 100, 105, 102, 
-    117, 115, 101,  76, 105, 103, 
-    104, 116, 115,   0,  97, 100, 
-    100, 105, 116, 105, 111, 110, 
-     97, 108,  84, 101, 120, 116, 
-    117, 114, 101,   0,  77,  97, 
-    116, 101, 114, 105,  97, 108, 
-      0,  76, 105, 103, 104, 116, 
-     67, 111, 117, 110, 116,   0, 
-     84, 101, 120, 116, 117, 114, 
-     69, 102, 102, 101,  99, 116, 
-      0, 171, 171, 171,  84,   1, 
-      0,   0,   3,   0,   0,   0, 
-    216,   1,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  93,   1, 
-      0,   0,   2,   0,   0,   0, 
-    164,   2,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 104,   1, 
-      0,   0,   2,   0,   0,   0, 
-     64,   3,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  53,   1, 
-      0,   0,   1,   0,   0,   0, 
-    220,   3,   0,   0,  24,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,  80,   2, 
-      0,   0,   0,   0,   0,   0, 
-      4,   0,   0,   0,   2,   0, 
-      0,   0, 100,   2,   0,   0, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0, 136,   2,   0,   0, 
-      4,   0,   0,   0,   4,   0, 
-      0,   0,   2,   0,   0,   0, 
-    100,   2,   0,   0,   0,   0, 
-      0,   0, 255, 255, 255, 255, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-    149,   2,   0,   0,   8,   0, 
-      0,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0, 100,   2, 
-      0,   0,   0,   0,   0,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0, 255, 255, 255, 255, 
-      0,   0,   0,   0,  97, 109, 
-     98, 105, 101, 110, 116,  70, 
-     97,  99, 116, 111, 114,   0, 
-    102, 108, 111,  97, 116,   0, 
-      0,   0,   3,   0,   1,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,  94,   2,   0,   0, 
-    100, 105, 102, 102, 117, 115, 
-     70,  97,  99, 116, 111, 114, 
-      0, 115, 112, 101,  99, 117, 
-    108,  97, 114,  70,  97,  99, 
-    116, 111, 114,   0, 244,   2, 
-      0,   0,   0,   0,   0,   0, 
-      4,   0,   0,   0,   2,   0, 
-      0,   0,  12,   3,   0,   0, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0,  48,   3,   0,   0, 
-      4,   0,   0,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-     12,   3,   0,   0,   0,   0, 
-      0,   0, 255, 255, 255, 255, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-    100, 105, 102, 102, 117, 115, 
-    101,  76, 105, 103, 104, 116, 
-     67, 111, 117, 110, 116,   0, 
-    105, 110, 116,   0, 171, 171, 
-      0,   0,   2,   0,   1,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   6,   3,   0,   0, 
-    112, 111, 105, 110, 116,  76, 
-    105, 103, 104, 116,  67, 111, 
-    117, 110, 116,   0, 144,   3, 
-      0,   0,   0,   0,   0,   0, 
-      4,   0,   0,   0,   2,   0, 
-      0,   0, 164,   3,   0,   0, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0, 200,   3,   0,   0, 
-      4,   0,   0,   0,   4,   0, 
-      0,   0,   2,   0,   0,   0, 
-    100,   2,   0,   0,   0,   0, 
-      0,   0, 255, 255, 255, 255, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-    101, 102, 102, 101,  99, 116, 
-     69, 110,  97,  98, 108, 101, 
-    100,   0,  98, 111, 111, 108, 
-      0, 171,   0,   0,   1,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 158,   3, 
-      0,   0, 101, 102, 102, 101, 
-     99, 116,  80, 101, 114,  99, 
-    101, 110, 116,  97, 103, 101, 
-      0, 171, 171, 171,   4,   4, 
-      0,   0,   0,   0,   0,   0, 
-     24,   0,   0,   0,   2,   0, 
-      0,   0, 112,   4,   0,   0, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0,  36,  69, 108, 101, 
-    109, 101, 110, 116,   0,  68, 
-    105, 102, 102, 117, 115, 101, 
-     76, 105, 103, 104, 116,   0, 
-    100, 105, 114, 101,  99, 116, 
-    105, 111, 110,   0, 102, 108, 
-    111,  97, 116,  51,   0, 171, 
-      1,   0,   3,   0,   1,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,  36,   4,   0,   0, 
-     99, 111, 108, 111, 114,   0, 
-    171, 171,  26,   4,   0,   0, 
-     44,   4,   0,   0,   0,   0, 
-      0,   0,  80,   4,   0,   0, 
-     44,   4,   0,   0,  12,   0, 
-      0,   0,   5,   0,   0,   0, 
-      1,   0,   6,   0,   0,   0, 
-      2,   0,  88,   4,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  13,   4, 
-      0,   0,  77, 105,  99, 114, 
-    111, 115, 111, 102, 116,  32, 
-     40,  82,  41,  32,  72,  76, 
-     83,  76,  32,  83, 104,  97, 
-    100, 101, 114,  32,  67, 111, 
-    109, 112, 105, 108, 101, 114, 
-     32,  49,  48,  46,  49,   0, 
-     73,  83,  71,  78, 184,   0, 
-      0,   0,   6,   0,   0,   0, 
-      8,   0,   0,   0, 152,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-     15,   0,   0,   0, 161,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   3,   0, 
-      0,   0,   1,   0,   0,   0, 
-     15,   0,   0,   0, 173,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   2,   0,   0,   0, 
-      3,   3,   0,   0, 173,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   3,   0,   0,   0, 
-      7,   7,   0,   0, 173,   0, 
-      0,   0,   2,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   4,   0,   0,   0, 
-     15,  15,   0,   0, 173,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   5,   0,   0,   0, 
-     15,   7,   0,   0,  80,  79, 
-     83,  73,  84,  73,  79,  78, 
-      0,  83,  86,  95,  80,  79, 
-     83,  73,  84,  73,  79,  78, 
-      0,  84,  69,  88,  67,  79, 
-     79,  82,  68,   0, 171, 171, 
-     79,  83,  71,  78,  44,   0, 
-      0,   0,   1,   0,   0,   0, 
-      8,   0,   0,   0,  32,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-     15,   0,   0,   0,  83,  86, 
-     95,  84,  65,  82,  71,  69, 
-     84,   0, 171, 171,  83,  72, 
-     69,  88, 184,   7,   0,   0, 
-     80,   0,   0,   0, 238,   1, 
-      0,   0, 106,   8,   0,   1, 
-     89,   0,   0,   4,  70, 142, 
-     32,   0,   1,   0,   0,   0, 
-      1,   0,   0,   0,  89,   0, 
-      0,   4,  70, 142,  32,   0, 
-      2,   0,   0,   0,   1,   0, 
-      0,   0,  89,   0,   0,   4, 
-     70, 142,  32,   0,   3,   0, 
-      0,   0,   1,   0,   0,   0, 
-     90,   0,   0,   3,   0,  96, 
-     16,   0,   0,   0,   0,   0, 
-     88,  24,   0,   4,   0, 112, 
-     16,   0,   0,   0,   0,   0, 
-     85,  85,   0,   0, 162,   0, 
-      0,   4,   0, 112,  16,   0, 
-      1,   0,   0,   0,  24,   0, 
-      0,   0,  88,  24,   0,   4, 
-      0, 112,  16,   0,   3,   0, 
-      0,   0,  85,  85,   0,   0, 
-     98,  16,   0,   3,  50,  16, 
-     16,   0,   2,   0,   0,   0, 
-     98,  16,   0,   3, 114,  16, 
-     16,   0,   3,   0,   0,   0, 
-     98,  16,   0,   3, 242,  16, 
-     16,   0,   4,   0,   0,   0, 
-     98,  16,   0,   3, 114,  16, 
-     16,   0,   5,   0,   0,   0, 
-    101,   0,   0,   3, 242,  32, 
-     16,   0,   0,   0,   0,   0, 
-    104,   0,   0,   2,   4,   0, 
-      0,   0,  69,   0,   0, 139, 
-    194,   0,   0, 128,  67,  85, 
-     21,   0, 242,   0,  16,   0, 
-      0,   0,   0,   0,  70,  16, 
-     16,   0,   2,   0,   0,   0, 
-     70, 126,  16,   0,   0,   0, 
-      0,   0,   0,  96,  16,   0, 
-      0,   0,   0,   0,  31,   0, 
-      4,   4,  10, 128,  32,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  49,   0,   0,   8, 
-     18,   0,  16,   0,   1,   0, 
-      0,   0,   1,  64,   0,   0, 
-      0,   0, 128,  63,  26, 128, 
-     32,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   8,  34,   0,  16,   0, 
-      1,   0,   0,   0,  26, 128, 
-     32,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,   1,  64, 
-      0,   0,   0,   0, 128, 191, 
-     55,   0,   0,  10,  34,   0, 
-     16,   0,   1,   0,   0,   0, 
-     10,   0,  16,   0,   1,   0, 
-      0,   0,  26,   0,  16,   0, 
-      1,   0,   0,   0,  26, 128, 
-     32,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,  59,   0, 
-      0,   5,  66,   0,  16,   0, 
-      1,   0,   0,   0,  10,   0, 
-     16,   0,   1,   0,   0,   0, 
-      0,   0,   0,   7, 130,   0, 
-     16,   0,   1,   0,   0,   0, 
-     58,   0,  16,   0,   0,   0, 
-      0,   0,   1,  64,   0,   0, 
-      0,   0, 128, 190,  49,   0, 
-      0,   7, 130,   0,  16,   0, 
-      1,   0,   0,   0,  58,   0, 
-     16,   0,   1,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   7, 
-     66,   0,  16,   0,   1,   0, 
-      0,   0,  42,   0,  16,   0, 
-      1,   0,   0,   0,  58,   0, 
-     16,   0,   1,   0,   0,   0, 
-     13,   0,   4,   3,  42,   0, 
-     16,   0,   1,   0,   0,   0, 
-      0,   0,   0,  10, 194,   0, 
-     16,   0,   1,   0,   0,   0, 
-      6,  20,  16,   0,   2,   0, 
-      0,   0,   2,  64,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0, 191, 
-      0,   0,   0, 191,  56,   0, 
-      0,   7, 194,   0,  16,   0, 
-      1,   0,   0,   0, 166,  14, 
-     16,   0,   1,   0,   0,   0, 
-    166,  14,  16,   0,   1,   0, 
-      0,   0,   0,   0,   0,   7, 
-     66,   0,  16,   0,   1,   0, 
-      0,   0,  58,   0,  16,   0, 
-      1,   0,   0,   0,  42,   0, 
-     16,   0,   1,   0,   0,   0, 
-     75,   0,   0,   5,  66,   0, 
-     16,   0,   1,   0,   0,   0, 
-     42,   0,  16,   0,   1,   0, 
-      0,   0,  56,   0,   0,   7, 
-    130,   0,  16,   0,   1,   0, 
-      0,   0,  42,   0,  16,   0, 
-      1,   0,   0,   0,   1,  64, 
-      0,   0, 243,   4, 181,  63, 
-     49,   0,   0,   7, 130,   0, 
-     16,   0,   1,   0,   0,   0, 
-     58,   0,  16,   0,   1,   0, 
-      0,   0,  26,   0,  16,   0, 
-      1,   0,   0,   0,  31,   0, 
-      4,   3,  58,   0,  16,   0, 
-      1,   0,   0,   0,  50,   0, 
-      0,  10,  34,   0,  16,   0, 
-      1,   0,   0,   0,  42,   0, 
-     16, 128,  65,   0,   0,   0, 
-      1,   0,   0,   0,   1,  64, 
-      0,   0, 243,   4, 181,  63, 
-     26,   0,  16,   0,   1,   0, 
-      0,   0,  56,   0,   0,   7, 
-     66,   0,  16,   0,   1,   0, 
-      0,   0,  26,   0,  16,   0, 
-      1,   0,   0,   0,   1,  64, 
-      0,   0,   0,   0, 160,  64, 
-     49,   0,   0,   7,  34,   0, 
-     16,   0,   1,   0,   0,   0, 
-      1,  64,   0,   0, 205, 204, 
-     76,  62,  26,   0,  16,   0, 
-      1,   0,   0,   0,  55,   0, 
-      0,   9,  34,   0,  16,   0, 
-      1,   0,   0,   0,  26,   0, 
-     16,   0,   1,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-    128,  63,  42,   0,  16,   0, 
-      1,   0,   0,   0,  69,   0, 
-      0, 139, 194,   0,   0, 128, 
-     67,  85,  21,   0, 242,   0, 
-     16,   0,   2,   0,   0,   0, 
-     70,  16,  16,   0,   2,   0, 
-      0,   0,  70, 126,  16,   0, 
-      3,   0,   0,   0,   0,  96, 
-     16,   0,   0,   0,   0,   0, 
-     56,   0,   0,   7,  66,   0, 
-     16,   0,   1,   0,   0,   0, 
-     26,   0,  16,   0,   1,   0, 
-      0,   0,  58,   0,  16,   0, 
-      2,   0,   0,   0,  50,   0, 
-      0,  10,  34,   0,  16,   0, 
-      1,   0,   0,   0,  58,   0, 
-     16, 128,  65,   0,   0,   0, 
-      2,   0,   0,   0,  26,   0, 
-     16,   0,   1,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-    128,  63,  56,   0,   0,   7, 
-    242,   0,  16,   0,   3,   0, 
-      0,   0,  70,  14,  16,   0, 
-      0,   0,   0,   0,  86,   5, 
-     16,   0,   1,   0,   0,   0, 
-     50,   0,   0,   9, 242,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70,  14,  16,   0,   2,   0, 
-      0,   0, 166,  10,  16,   0, 
-      1,   0,   0,   0,  70,  14, 
-     16,   0,   3,   0,   0,   0, 
-     49,   0,   0,   7,  34,   0, 
-     16,   0,   1,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-    128,  63,  42,   0,  16,   0, 
-      1,   0,   0,   0,  55,   0, 
-      0,   9,  34,   0,  16,   0, 
-      1,   0,   0,   0,  26,   0, 
-     16,   0,   1,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-    128,  63,  42,   0,  16,   0, 
-      1,   0,   0,   0,  55,   0, 
-      0,   9, 130,   0,  16,   0, 
-      0,   0,   0,   0,  10,   0, 
-     16,   0,   1,   0,   0,   0, 
-     26,   0,  16,   0,   1,   0, 
-      0,   0,  58,   0,  16,   0, 
-      0,   0,   0,   0,  21,   0, 
-      0,   1,  18,   0,   0,   1, 
-      0,   0,   0,   7,  18,   0, 
-     16,   0,   1,   0,   0,   0, 
-     58,   0,  16,   0,   0,   0, 
-      0,   0,   1,  64,   0,   0, 
-      0,   0, 128, 190,  49,   0, 
-      0,   7,  18,   0,  16,   0, 
-      1,   0,   0,   0,  10,   0, 
-     16,   0,   1,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-      0,   0,  13,   0,   4,   3, 
-     10,   0,  16,   0,   1,   0, 
-      0,   0,  21,   0,   0,   1, 
-     49,   0,   0,   7,  18,   0, 
-     16,   0,   1,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-      0,   0,  58,  16,  16,   0, 
-      4,   0,   0,   0,  31,   0, 
-      4,   3,  10,   0,  16,   0, 
-      1,   0,   0,   0,  56,   0, 
-      0,   7, 114,   0,  16,   0, 
-      1,   0,   0,   0,  70,   2, 
-     16,   0,   0,   0,   0,   0, 
-     70,  18,  16,   0,   4,   0, 
-      0,   0,  56,   0,   0,   7, 
-    114,   0,  16,   0,   2,   0, 
-      0,   0,  70,   2,  16,   0, 
-      0,   0,   0,   0,  70,  18, 
-     16,   0,   5,   0,   0,   0, 
-     34,   0,   0,   8, 130,   0, 
-     16,   0,   1,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-      0,   0,  10, 128,  32,   0, 
-      2,   0,   0,   0,   0,   0, 
-      0,   0, 167,   0,   0, 139, 
-      2, 195,   0, 128, 131, 153, 
-     25,   0, 114,   0,  16,   0, 
-      3,   0,   0,   0,   1,  64, 
-      0,   0,   0,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-      0,   0,  70, 114,  16,   0, 
-      1,   0,   0,   0,  16,   0, 
-      0,   8, 130,   0,  16,   0, 
-      2,   0,   0,   0,  70,  18, 
-     16,   0,   3,   0,   0,   0, 
-     70,   2,  16, 128,  65,   0, 
-      0,   0,   3,   0,   0,   0, 
-     49,   0,   0,   7,  18,   0, 
-     16,   0,   3,   0,   0,   0, 
-     58,   0,  16,   0,   2,   0, 
-      0,   0,   1,  64,   0,   0, 
-      0,   0,   0,   0,  50,   0, 
-      0,   9, 130,   0,  16,   0, 
-      2,   0,   0,   0,  58,   0, 
-     16,   0,   2,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-      0,  63,   1,  64,   0,   0, 
-      0,   0,   0,  63,  55,   0, 
-      0,   9, 130,   0,  16,   0, 
-      2,   0,   0,   0,  10,   0, 
-     16,   0,   3,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-      0,  63,  58,   0,  16,   0, 
-      2,   0,   0,   0,  56,   0, 
-      0,   7, 114,   0,  16,   0, 
-      3,   0,   0,   0,  70,   2, 
-     16,   0,   1,   0,   0,   0, 
-    246,  15,  16,   0,   2,   0, 
-      0,   0,  56,   0,   0,  10, 
-    114,   0,  16,   0,   1,   0, 
-      0,   0,  70,   2,  16,   0, 
-      1,   0,   0,   0,   2,  64, 
-      0,   0,   0,   0,   0,  63, 
-      0,   0,   0,  63,   0,   0, 
-      0,  63,   0,   0,   0,   0, 
-     55,   0,   0,   9, 114,   0, 
-     16,   0,   1,   0,   0,   0, 
-    246,  15,  16,   0,   1,   0, 
-      0,   0,  70,   2,  16,   0, 
-      3,   0,   0,   0,  70,   2, 
-     16,   0,   1,   0,   0,   0, 
-     49,   0,   0,   7, 114,   0, 
-     16,   0,   3,   0,   0,   0, 
-     70,   2,  16,   0,   1,   0, 
-      0,   0,  70,   2,  16,   0, 
-      2,   0,   0,   0,  55,   0, 
-      0,   9, 114,   0,  16,   0, 
-      1,   0,   0,   0,  70,   2, 
-     16,   0,   3,   0,   0,   0, 
-     70,   2,  16,   0,   2,   0, 
-      0,   0,  70,   2,  16,   0, 
-      1,   0,   0,   0,  18,   0, 
-      0,   1,  54,   0,   0,   8, 
-    114,   0,  16,   0,   1,   0, 
-      0,   0,   2,  64,   0,   0, 
-      0,   0, 128,  63,   0,   0, 
-    128,  63,   0,   0, 128,  63, 
-      0,   0,   0,   0,  21,   0, 
-      0,   1,  56,   0,   0,   8, 
-    114,   0,  16,   0,   1,   0, 
-      0,   0,  70,   2,  16,   0, 
-      1,   0,   0,   0,  86, 133, 
-     32,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,  50,  32, 
-      0,  10, 114,   0,  16,   0, 
-      0,   0,   0,   0,  70,   2, 
-     16,   0,   0,   0,   0,   0, 
-      6, 128,  32,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-     70,   2,  16,   0,   1,   0, 
-      0,   0,  57,   0,   0,   7, 
-     18,   0,  16,   0,   1,   0, 
-      0,   0,  10,   0,  16,   0, 
-      1,   0,   0,   0,  10,   0, 
-     16,   0,   1,   0,   0,   0, 
-     13,   0,   4,   3,  10,   0, 
-     16,   0,   1,   0,   0,   0, 
-     39,   0,   0,   8,  18,   0, 
-     16,   0,   1,   0,   0,   0, 
-     10, 128,  32,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-      0,   0,  24,   0,   0,   8, 
-     34,   0,  16,   0,   1,   0, 
-      0,   0,  26, 128,  32,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   1,  64,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   7,  18,   0,  16,   0, 
-      1,   0,   0,   0,  26,   0, 
-     16,   0,   1,   0,   0,   0, 
-     10,   0,  16,   0,   1,   0, 
-      0,   0,   0,   0,   0,   7, 
-     34,   0,  16,   0,   1,   0, 
-      0,   0,  58,   0,  16,   0, 
-      0,   0,   0,   0,   1,  64, 
-      0,   0,   0,   0,   0, 191, 
-     49,   0,   0,   7,  34,   0, 
-     16,   0,   1,   0,   0,   0, 
-     26,   0,  16,   0,   1,   0, 
-      0,   0,   1,  64,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   7,  18,   0,  16,   0, 
-      1,   0,   0,   0,  10,   0, 
-     16,   0,   1,   0,   0,   0, 
-     26,   0,  16,   0,   1,   0, 
-      0,   0,  13,   0,   4,   3, 
-     10,   0,  16,   0,   1,   0, 
-      0,   0,  54,   0,   0,   5, 
-    242,  32,  16,   0,   0,   0, 
-      0,   0,  70,  14,  16,   0, 
-      0,   0,   0,   0,  62,   0, 
-      0,   1,  83,  84,  65,  84, 
-    148,   0,   0,   0,  66,   0, 
-      0,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   5,   0, 
-      0,   0,  35,   0,   0,   0, 
-      2,   0,   0,   0,   4,   0, 
-      0,   0,   4,   0,   0,   0, 
-      2,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      2,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   2,   0,   0,   0, 
-      7,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0
-};

+ 0 - 735
FactoryCraft/CustomUIDX11VertexShader.h

@@ -1,735 +0,0 @@
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer MatrixBuffer
-// {
-//
-//   float4x4 knochenMatrix[128];       // Offset:    0 Size:  8192
-//
-// }
-//
-// cbuffer Kamera
-// {
-//
-//   float4x4 view;                     // Offset:    0 Size:    64
-//   float4x4 projection;               // Offset:   64 Size:    64
-//
-// }
-//
-// cbuffer LightController
-// {
-//
-//   uint lightLength;                  // Offset:    0 Size:     4
-//   float dayLightFactor;              // Offset:    4 Size:     4
-//
-// }
-//
-// Resource bind info for lightBuffer
-// {
-//
-//   struct VertexLight
-//   {
-//       
-//       uint dayLight1;                // Offset:    0
-//       uint dynamicLight1;            // Offset:    4
-//       uint dayLight2;                // Offset:    8
-//       uint dynamicLight2;            // Offset:   12
-//
-//   } $Element;                        // Offset:    0 Size:    16
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// lightBuffer                       texture  struct         r/o             t0      1 
-// MatrixBuffer                      cbuffer      NA          NA            cb0      1 
-// Kamera                            cbuffer      NA          NA            cb1      1 
-// LightController                   cbuffer      NA          NA            cb2      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// POSITION                 0   xyzw        0     NONE   float   xyz 
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-// NORMAL                   0   xyz         2     NONE   float   xyz 
-// KNOCHEN_ID               0   x           3     NONE    uint   x   
-// VERTEX_ID                0   x           4     NONE    uint   x   
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// POSITION                 0   xyzw        0     NONE   float   xyzw
-// SV_POSITION              0   xyzw        1      POS   float   xyzw
-// TEXCOORD                 0   xy          2     NONE   float   xy  
-// TEXCOORD                 1   xyz         3     NONE   float   xyz 
-// TEXCOORD                 2   xyzw        4     NONE   float   xyzw
-// TEXCOORD                 3   xyzw        5     NONE   float   xyzw
-//
-vs_5_0
-dcl_globalFlags refactoringAllowed
-dcl_constantbuffer CB0[512], dynamicIndexed
-dcl_constantbuffer CB1[8], immediateIndexed
-dcl_constantbuffer CB2[1], immediateIndexed
-dcl_resource_structured t0, 16
-dcl_input v0.xyz
-dcl_input v1.xy
-dcl_input v2.xyz
-dcl_input v3.x
-dcl_input v4.x
-dcl_output o0.xyzw
-dcl_output_siv o1.xyzw, position
-dcl_output o2.xy
-dcl_output o3.xyz
-dcl_output o4.xyzw
-dcl_output o5.xyzw
-dcl_temps 4
-ishl r0.x, v3.x, l(2)
-dp3 r1.x, v2.xyzx, cb0[r0.x + 0].xyzx
-dp3 r1.y, v2.xyzx, cb0[r0.x + 1].xyzx
-dp3 r1.z, v2.xyzx, cb0[r0.x + 2].xyzx
-dp3 r0.y, r1.xyzx, r1.xyzx
-rsq r0.y, r0.y
-mul o3.xyz, r0.yyyy, r1.xyzx
-mov r1.xyz, v0.xyzx
-mov r1.w, l(1.000000)
-dp4 r2.x, r1.xyzw, cb0[r0.x + 0].xyzw
-dp4 r2.y, r1.xyzw, cb0[r0.x + 1].xyzw
-dp4 r2.z, r1.xyzw, cb0[r0.x + 2].xyzw
-dp4 r2.w, r1.xyzw, cb0[r0.x + 3].xyzw
-dp4 r0.x, r2.xyzw, cb1[0].xyzw
-dp4 r0.y, r2.xyzw, cb1[1].xyzw
-dp4 r0.z, r2.xyzw, cb1[2].xyzw
-dp4 r0.w, r2.xyzw, cb1[3].xyzw
-dp4 o1.x, r0.xyzw, cb1[4].xyzw
-dp4 o1.y, r0.xyzw, cb1[5].xyzw
-dp4 o1.z, r0.xyzw, cb1[6].xyzw
-dp4 o1.w, r0.xyzw, cb1[7].xyzw
-ieq r0.x, cb2[0].x, l(1)
-if_nz r0.x
-  ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r0.xy, l(0), l(0), t0.xyxx
-else 
-  ult r0.z, v4.x, cb2[0].x
-  and r0.w, v4.x, l(1)
-  ushr r1.x, v4.x, l(1)
-  ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r1.xyzw, r1.x, l(0), t0.xyzw
-  movc r1.xy, r0.wwww, r1.zwzz, r1.xyxx
-  and r0.xy, r0.zzzz, r1.xyxx
-endif 
-ult r0.z, v4.x, cb2[0].x
-ushr r0.w, r0.x, l(24)
-utof r0.w, r0.w
-mul r0.w, r0.w, cb2[0].y
-mul r1.x, r0.w, l(0.003922)
-ubfe r0.xw, l(8, 0, 0, 8), l(16, 0, 0, 8), r0.xxxx
-utof r0.xw, r0.xxxw
-mul r0.xw, r0.xxxw, cb2[0].yyyy
-mul r1.yz, r0.xxwx, l(0.000000, 0.003922, 0.003922, 0.000000)
-ushr r0.x, r0.y, l(24)
-utof r0.x, r0.x
-mul r3.x, r0.x, l(0.003922)
-ubfe r0.xy, l(8, 8, 0, 0), l(16, 8, 0, 0), r0.yyyy
-utof r0.xy, r0.xyxx
-mul r3.yz, r0.xxyx, l(0.000000, 0.003922, 0.003922, 0.000000)
-mov r1.w, l(1.000000)
-movc o4.xyzw, r0.zzzz, r1.xyzw, l(1.000000,1.000000,1.000000,0)
-and o5.xyz, r0.zzzz, r3.xyzx
-mov o0.xyzw, r2.xyzw
-mov o5.w, l(0)
-mov o2.xy, v1.xyxx
-ret 
-// Approximately 54 instruction slots used
-#endif
-
-const BYTE CustomUIDX11VertexShader[] =
-{
-     68,  88,  66,  67,  46,  83, 
-    101,  93, 183, 247,  20,  27, 
-     32,  43, 254, 212, 139,  66, 
-    197,  75,   1,   0,   0,   0, 
-    140,  13,   0,   0,   5,   0, 
-      0,   0,  52,   0,   0,   0, 
-     72,   4,   0,   0,   0,   5, 
-      0,   0, 192,   5,   0,   0, 
-    240,  12,   0,   0,  82,  68, 
-     69,  70,  12,   4,   0,   0, 
-      4,   0,   0,   0, 236,   0, 
-      0,   0,   4,   0,   0,   0, 
-     60,   0,   0,   0,   0,   5, 
-    254, 255,   0,   1,   0,   0, 
-    228,   3,   0,   0,  82,  68, 
-     49,  49,  60,   0,   0,   0, 
-     24,   0,   0,   0,  32,   0, 
-      0,   0,  40,   0,   0,   0, 
-     36,   0,   0,   0,  12,   0, 
-      0,   0,   0,   0,   0,   0, 
-    188,   0,   0,   0,   5,   0, 
-      0,   0,   6,   0,   0,   0, 
-      1,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   1,   0, 
-      0,   0, 200,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      1,   0,   0,   0, 213,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-    220,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   2,   0,   0,   0, 
-      1,   0,   0,   0,   1,   0, 
-      0,   0, 108, 105, 103, 104, 
-    116,  66, 117, 102, 102, 101, 
-    114,   0,  77,  97, 116, 114, 
-    105, 120,  66, 117, 102, 102, 
-    101, 114,   0,  75,  97, 109, 
-    101, 114,  97,   0,  76, 105, 
-    103, 104, 116,  67, 111, 110, 
-    116, 114, 111, 108, 108, 101, 
-    114,   0, 200,   0,   0,   0, 
-      1,   0,   0,   0,  76,   1, 
-      0,   0,   0,  32,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 213,   0,   0,   0, 
-      2,   0,   0,   0, 176,   1, 
-      0,   0, 128,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 220,   0,   0,   0, 
-      2,   0,   0,   0,  56,   2, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 188,   0,   0,   0, 
-      1,   0,   0,   0, 252,   2, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0, 116,   1,   0,   0, 
-      0,   0,   0,   0,   0,  32, 
-      0,   0,   2,   0,   0,   0, 
-    140,   1,   0,   0,   0,   0, 
-      0,   0, 255, 255, 255, 255, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-    107, 110, 111,  99, 104, 101, 
-    110,  77,  97, 116, 114, 105, 
-    120,   0, 102, 108, 111,  97, 
-    116,  52, 120,  52,   0, 171, 
-      3,   0,   3,   0,   4,   0, 
-      4,   0, 128,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 130,   1,   0,   0, 
-      0,   2,   0,   0,   0,   0, 
-      0,   0,  64,   0,   0,   0, 
-      2,   0,   0,   0,   8,   2, 
-      0,   0,   0,   0,   0,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0, 255, 255, 255, 255, 
-      0,   0,   0,   0,  44,   2, 
-      0,   0,  64,   0,   0,   0, 
-     64,   0,   0,   0,   2,   0, 
-      0,   0,   8,   2,   0,   0, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0, 118, 105, 101, 119, 
-      0, 171, 171, 171,   3,   0, 
-      3,   0,   4,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    130,   1,   0,   0, 112, 114, 
-    111, 106, 101,  99, 116, 105, 
-    111, 110,   0, 171, 136,   2, 
-      0,   0,   0,   0,   0,   0, 
-      4,   0,   0,   0,   2,   0, 
-      0,   0, 156,   2,   0,   0, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0, 192,   2,   0,   0, 
-      4,   0,   0,   0,   4,   0, 
-      0,   0,   2,   0,   0,   0, 
-    216,   2,   0,   0,   0,   0, 
-      0,   0, 255, 255, 255, 255, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-    108, 105, 103, 104, 116,  76, 
-    101, 110, 103, 116, 104,   0, 
-    100, 119, 111, 114, 100,   0, 
-    171, 171,   0,   0,  19,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 148,   2, 
-      0,   0, 100,  97, 121,  76, 
-    105, 103, 104, 116,  70,  97, 
-     99, 116, 111, 114,   0, 102, 
-    108, 111,  97, 116,   0, 171, 
-    171, 171,   0,   0,   3,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 207,   2, 
-      0,   0,  36,   3,   0,   0, 
-      0,   0,   0,   0,  16,   0, 
-      0,   0,   2,   0,   0,   0, 
-    192,   3,   0,   0,   0,   0, 
-      0,   0, 255, 255, 255, 255, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-     36,  69, 108, 101, 109, 101, 
-    110, 116,   0,  86, 101, 114, 
-    116, 101, 120,  76, 105, 103, 
-    104, 116,   0, 100,  97, 121, 
-     76, 105, 103, 104, 116,  49, 
-      0, 171,   0,   0,  19,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 148,   2, 
-      0,   0, 100, 121, 110,  97, 
-    109, 105,  99,  76, 105, 103, 
-    104, 116,  49,   0, 100,  97, 
-    121,  76, 105, 103, 104, 116, 
-     50,   0, 100, 121, 110,  97, 
-    109, 105,  99,  76, 105, 103, 
-    104, 116,  50,   0, 171, 171, 
-     57,   3,   0,   0,  68,   3, 
-      0,   0,   0,   0,   0,   0, 
-    104,   3,   0,   0,  68,   3, 
-      0,   0,   4,   0,   0,   0, 
-    118,   3,   0,   0,  68,   3, 
-      0,   0,   8,   0,   0,   0, 
-    128,   3,   0,   0,  68,   3, 
-      0,   0,  12,   0,   0,   0, 
-      5,   0,   0,   0,   1,   0, 
-      4,   0,   0,   0,   4,   0, 
-    144,   3,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,  45,   3,   0,   0, 
-     77, 105,  99, 114, 111, 115, 
-    111, 102, 116,  32,  40,  82, 
-     41,  32,  72,  76,  83,  76, 
-     32,  83, 104,  97, 100, 101, 
-    114,  32,  67, 111, 109, 112, 
-    105, 108, 101, 114,  32,  49, 
-     48,  46,  49,   0,  73,  83, 
-     71,  78, 176,   0,   0,   0, 
-      5,   0,   0,   0,   8,   0, 
-      0,   0, 128,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,  15,   7, 
-      0,   0, 137,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      1,   0,   0,   0,   3,   3, 
-      0,   0, 146,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      2,   0,   0,   0,   7,   7, 
-      0,   0, 153,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      3,   0,   0,   0,   1,   1, 
-      0,   0, 164,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      4,   0,   0,   0,   1,   1, 
-      0,   0,  80,  79,  83,  73, 
-     84,  73,  79,  78,   0,  84, 
-     69,  88,  67,  79,  79,  82, 
-     68,   0,  78,  79,  82,  77, 
-     65,  76,   0,  75,  78,  79, 
-     67,  72,  69,  78,  95,  73, 
-     68,   0,  86,  69,  82,  84, 
-     69,  88,  95,  73,  68,   0, 
-    171, 171,  79,  83,  71,  78, 
-    184,   0,   0,   0,   6,   0, 
-      0,   0,   8,   0,   0,   0, 
-    152,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-    161,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      3,   0,   0,   0,   1,   0, 
-      0,   0,  15,   0,   0,   0, 
-    173,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   2,   0, 
-      0,   0,   3,  12,   0,   0, 
-    173,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   3,   0, 
-      0,   0,   7,   8,   0,   0, 
-    173,   0,   0,   0,   2,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   4,   0, 
-      0,   0,  15,   0,   0,   0, 
-    173,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   5,   0, 
-      0,   0,  15,   0,   0,   0, 
-     80,  79,  83,  73,  84,  73, 
-     79,  78,   0,  83,  86,  95, 
-     80,  79,  83,  73,  84,  73, 
-     79,  78,   0,  84,  69,  88, 
-     67,  79,  79,  82,  68,   0, 
-    171, 171,  83,  72,  69,  88, 
-     40,   7,   0,   0,  80,   0, 
-      1,   0, 202,   1,   0,   0, 
-    106,   8,   0,   1,  89,   8, 
-      0,   4,  70, 142,  32,   0, 
-      0,   0,   0,   0,   0,   2, 
-      0,   0,  89,   0,   0,   4, 
-     70, 142,  32,   0,   1,   0, 
-      0,   0,   8,   0,   0,   0, 
-     89,   0,   0,   4,  70, 142, 
-     32,   0,   2,   0,   0,   0, 
-      1,   0,   0,   0, 162,   0, 
-      0,   4,   0, 112,  16,   0, 
-      0,   0,   0,   0,  16,   0, 
-      0,   0,  95,   0,   0,   3, 
-    114,  16,  16,   0,   0,   0, 
-      0,   0,  95,   0,   0,   3, 
-     50,  16,  16,   0,   1,   0, 
-      0,   0,  95,   0,   0,   3, 
-    114,  16,  16,   0,   2,   0, 
-      0,   0,  95,   0,   0,   3, 
-     18,  16,  16,   0,   3,   0, 
-      0,   0,  95,   0,   0,   3, 
-     18,  16,  16,   0,   4,   0, 
-      0,   0, 101,   0,   0,   3, 
-    242,  32,  16,   0,   0,   0, 
-      0,   0, 103,   0,   0,   4, 
-    242,  32,  16,   0,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-    101,   0,   0,   3,  50,  32, 
-     16,   0,   2,   0,   0,   0, 
-    101,   0,   0,   3, 114,  32, 
-     16,   0,   3,   0,   0,   0, 
-    101,   0,   0,   3, 242,  32, 
-     16,   0,   4,   0,   0,   0, 
-    101,   0,   0,   3, 242,  32, 
-     16,   0,   5,   0,   0,   0, 
-    104,   0,   0,   2,   4,   0, 
-      0,   0,  41,   0,   0,   7, 
-     18,   0,  16,   0,   0,   0, 
-      0,   0,  10,  16,  16,   0, 
-      3,   0,   0,   0,   1,  64, 
-      0,   0,   2,   0,   0,   0, 
-     16,   0,   0,   9,  18,   0, 
-     16,   0,   1,   0,   0,   0, 
-     70,  18,  16,   0,   2,   0, 
-      0,   0,  70, 130,  32,   4, 
-      0,   0,   0,   0,  10,   0, 
-     16,   0,   0,   0,   0,   0, 
-     16,   0,   0,  10,  34,   0, 
-     16,   0,   1,   0,   0,   0, 
-     70,  18,  16,   0,   2,   0, 
-      0,   0,  70, 130,  32,   6, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,  10,   0,  16,   0, 
-      0,   0,   0,   0,  16,   0, 
-      0,  10,  66,   0,  16,   0, 
-      1,   0,   0,   0,  70,  18, 
-     16,   0,   2,   0,   0,   0, 
-     70, 130,  32,   6,   0,   0, 
-      0,   0,   2,   0,   0,   0, 
-     10,   0,  16,   0,   0,   0, 
-      0,   0,  16,   0,   0,   7, 
-     34,   0,  16,   0,   0,   0, 
-      0,   0,  70,   2,  16,   0, 
-      1,   0,   0,   0,  70,   2, 
-     16,   0,   1,   0,   0,   0, 
-     68,   0,   0,   5,  34,   0, 
-     16,   0,   0,   0,   0,   0, 
-     26,   0,  16,   0,   0,   0, 
-      0,   0,  56,   0,   0,   7, 
-    114,  32,  16,   0,   3,   0, 
-      0,   0,  86,   5,  16,   0, 
-      0,   0,   0,   0,  70,   2, 
-     16,   0,   1,   0,   0,   0, 
-     54,   0,   0,   5, 114,   0, 
-     16,   0,   1,   0,   0,   0, 
-     70,  18,  16,   0,   0,   0, 
-      0,   0,  54,   0,   0,   5, 
-    130,   0,  16,   0,   1,   0, 
-      0,   0,   1,  64,   0,   0, 
-      0,   0, 128,  63,  17,   0, 
-      0,   9,  18,   0,  16,   0, 
-      2,   0,   0,   0,  70,  14, 
-     16,   0,   1,   0,   0,   0, 
-     70, 142,  32,   4,   0,   0, 
-      0,   0,  10,   0,  16,   0, 
-      0,   0,   0,   0,  17,   0, 
-      0,  10,  34,   0,  16,   0, 
-      2,   0,   0,   0,  70,  14, 
-     16,   0,   1,   0,   0,   0, 
-     70, 142,  32,   6,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-     10,   0,  16,   0,   0,   0, 
-      0,   0,  17,   0,   0,  10, 
-     66,   0,  16,   0,   2,   0, 
-      0,   0,  70,  14,  16,   0, 
-      1,   0,   0,   0,  70, 142, 
-     32,   6,   0,   0,   0,   0, 
-      2,   0,   0,   0,  10,   0, 
-     16,   0,   0,   0,   0,   0, 
-     17,   0,   0,  10, 130,   0, 
-     16,   0,   2,   0,   0,   0, 
-     70,  14,  16,   0,   1,   0, 
-      0,   0,  70, 142,  32,   6, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,  10,   0,  16,   0, 
-      0,   0,   0,   0,  17,   0, 
-      0,   8,  18,   0,  16,   0, 
-      0,   0,   0,   0,  70,  14, 
-     16,   0,   2,   0,   0,   0, 
-     70, 142,  32,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-     17,   0,   0,   8,  34,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70,  14,  16,   0,   2,   0, 
-      0,   0,  70, 142,  32,   0, 
-      1,   0,   0,   0,   1,   0, 
-      0,   0,  17,   0,   0,   8, 
-     66,   0,  16,   0,   0,   0, 
-      0,   0,  70,  14,  16,   0, 
-      2,   0,   0,   0,  70, 142, 
-     32,   0,   1,   0,   0,   0, 
-      2,   0,   0,   0,  17,   0, 
-      0,   8, 130,   0,  16,   0, 
-      0,   0,   0,   0,  70,  14, 
-     16,   0,   2,   0,   0,   0, 
-     70, 142,  32,   0,   1,   0, 
-      0,   0,   3,   0,   0,   0, 
-     17,   0,   0,   8,  18,  32, 
-     16,   0,   1,   0,   0,   0, 
-     70,  14,  16,   0,   0,   0, 
-      0,   0,  70, 142,  32,   0, 
-      1,   0,   0,   0,   4,   0, 
-      0,   0,  17,   0,   0,   8, 
-     34,  32,  16,   0,   1,   0, 
-      0,   0,  70,  14,  16,   0, 
-      0,   0,   0,   0,  70, 142, 
-     32,   0,   1,   0,   0,   0, 
-      5,   0,   0,   0,  17,   0, 
-      0,   8,  66,  32,  16,   0, 
-      1,   0,   0,   0,  70,  14, 
-     16,   0,   0,   0,   0,   0, 
-     70, 142,  32,   0,   1,   0, 
-      0,   0,   6,   0,   0,   0, 
-     17,   0,   0,   8, 130,  32, 
-     16,   0,   1,   0,   0,   0, 
-     70,  14,  16,   0,   0,   0, 
-      0,   0,  70, 142,  32,   0, 
-      1,   0,   0,   0,   7,   0, 
-      0,   0,  32,   0,   0,   8, 
-     18,   0,  16,   0,   0,   0, 
-      0,   0,  10, 128,  32,   0, 
-      2,   0,   0,   0,   0,   0, 
-      0,   0,   1,  64,   0,   0, 
-      1,   0,   0,   0,  31,   0, 
-      4,   3,  10,   0,  16,   0, 
-      0,   0,   0,   0, 167,   0, 
-      0, 139,   2, 131,   0, 128, 
-    131, 153,  25,   0,  50,   0, 
-     16,   0,   0,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-      0,   0,   1,  64,   0,   0, 
-      0,   0,   0,   0,  70, 112, 
-     16,   0,   0,   0,   0,   0, 
-     18,   0,   0,   1,  79,   0, 
-      0,   8,  66,   0,  16,   0, 
-      0,   0,   0,   0,  10,  16, 
-     16,   0,   4,   0,   0,   0, 
-     10, 128,  32,   0,   2,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   7, 130,   0, 
-     16,   0,   0,   0,   0,   0, 
-     10,  16,  16,   0,   4,   0, 
-      0,   0,   1,  64,   0,   0, 
-      1,   0,   0,   0,  85,   0, 
-      0,   7,  18,   0,  16,   0, 
-      1,   0,   0,   0,  10,  16, 
-     16,   0,   4,   0,   0,   0, 
-      1,  64,   0,   0,   1,   0, 
-      0,   0, 167,   0,   0, 139, 
-      2, 131,   0, 128, 131, 153, 
-     25,   0, 242,   0,  16,   0, 
-      1,   0,   0,   0,  10,   0, 
-     16,   0,   1,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-      0,   0,  70, 126,  16,   0, 
-      0,   0,   0,   0,  55,   0, 
-      0,   9,  50,   0,  16,   0, 
-      1,   0,   0,   0, 246,  15, 
-     16,   0,   0,   0,   0,   0, 
-    230,  10,  16,   0,   1,   0, 
-      0,   0,  70,   0,  16,   0, 
-      1,   0,   0,   0,   1,   0, 
-      0,   7,  50,   0,  16,   0, 
-      0,   0,   0,   0, 166,  10, 
-     16,   0,   0,   0,   0,   0, 
-     70,   0,  16,   0,   1,   0, 
-      0,   0,  21,   0,   0,   1, 
-     79,   0,   0,   8,  66,   0, 
-     16,   0,   0,   0,   0,   0, 
-     10,  16,  16,   0,   4,   0, 
-      0,   0,  10, 128,  32,   0, 
-      2,   0,   0,   0,   0,   0, 
-      0,   0,  85,   0,   0,   7, 
-    130,   0,  16,   0,   0,   0, 
-      0,   0,  10,   0,  16,   0, 
-      0,   0,   0,   0,   1,  64, 
-      0,   0,  24,   0,   0,   0, 
-     86,   0,   0,   5, 130,   0, 
-     16,   0,   0,   0,   0,   0, 
-     58,   0,  16,   0,   0,   0, 
-      0,   0,  56,   0,   0,   8, 
-    130,   0,  16,   0,   0,   0, 
-      0,   0,  58,   0,  16,   0, 
-      0,   0,   0,   0,  26, 128, 
-     32,   0,   2,   0,   0,   0, 
-      0,   0,   0,   0,  56,   0, 
-      0,   7,  18,   0,  16,   0, 
-      1,   0,   0,   0,  58,   0, 
-     16,   0,   0,   0,   0,   0, 
-      1,  64,   0,   0, 129, 128, 
-    128,  59, 138,   0,   0,  15, 
-    146,   0,  16,   0,   0,   0, 
-      0,   0,   2,  64,   0,   0, 
-      8,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      8,   0,   0,   0,   2,  64, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   8,   0,   0,   0, 
-      6,   0,  16,   0,   0,   0, 
-      0,   0,  86,   0,   0,   5, 
-    146,   0,  16,   0,   0,   0, 
-      0,   0,   6,  12,  16,   0, 
-      0,   0,   0,   0,  56,   0, 
-      0,   8, 146,   0,  16,   0, 
-      0,   0,   0,   0,   6,  12, 
-     16,   0,   0,   0,   0,   0, 
-     86, 133,  32,   0,   2,   0, 
-      0,   0,   0,   0,   0,   0, 
-     56,   0,   0,  10,  98,   0, 
-     16,   0,   1,   0,   0,   0, 
-      6,   3,  16,   0,   0,   0, 
-      0,   0,   2,  64,   0,   0, 
-      0,   0,   0,   0, 129, 128, 
-    128,  59, 129, 128, 128,  59, 
-      0,   0,   0,   0,  85,   0, 
-      0,   7,  18,   0,  16,   0, 
-      0,   0,   0,   0,  26,   0, 
-     16,   0,   0,   0,   0,   0, 
-      1,  64,   0,   0,  24,   0, 
-      0,   0,  86,   0,   0,   5, 
-     18,   0,  16,   0,   0,   0, 
-      0,   0,  10,   0,  16,   0, 
-      0,   0,   0,   0,  56,   0, 
-      0,   7,  18,   0,  16,   0, 
-      3,   0,   0,   0,  10,   0, 
-     16,   0,   0,   0,   0,   0, 
-      1,  64,   0,   0, 129, 128, 
-    128,  59, 138,   0,   0,  15, 
-     50,   0,  16,   0,   0,   0, 
-      0,   0,   2,  64,   0,   0, 
-      8,   0,   0,   0,   8,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   2,  64, 
-      0,   0,  16,   0,   0,   0, 
-      8,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-     86,   5,  16,   0,   0,   0, 
-      0,   0,  86,   0,   0,   5, 
-     50,   0,  16,   0,   0,   0, 
-      0,   0,  70,   0,  16,   0, 
-      0,   0,   0,   0,  56,   0, 
-      0,  10,  98,   0,  16,   0, 
-      3,   0,   0,   0,   6,   1, 
-     16,   0,   0,   0,   0,   0, 
-      2,  64,   0,   0,   0,   0, 
-      0,   0, 129, 128, 128,  59, 
-    129, 128, 128,  59,   0,   0, 
-      0,   0,  54,   0,   0,   5, 
-    130,   0,  16,   0,   1,   0, 
-      0,   0,   1,  64,   0,   0, 
-      0,   0, 128,  63,  55,   0, 
-      0,  12, 242,  32,  16,   0, 
-      4,   0,   0,   0, 166,  10, 
-     16,   0,   0,   0,   0,   0, 
-     70,  14,  16,   0,   1,   0, 
-      0,   0,   2,  64,   0,   0, 
-      0,   0, 128,  63,   0,   0, 
-    128,  63,   0,   0, 128,  63, 
-      0,   0,   0,   0,   1,   0, 
-      0,   7, 114,  32,  16,   0, 
-      5,   0,   0,   0, 166,  10, 
-     16,   0,   0,   0,   0,   0, 
-     70,   2,  16,   0,   3,   0, 
-      0,   0,  54,   0,   0,   5, 
-    242,  32,  16,   0,   0,   0, 
-      0,   0,  70,  14,  16,   0, 
-      2,   0,   0,   0,  54,   0, 
-      0,   5, 130,  32,  16,   0, 
-      5,   0,   0,   0,   1,  64, 
-      0,   0,   0,   0,   0,   0, 
-     54,   0,   0,   5,  50,  32, 
-     16,   0,   2,   0,   0,   0, 
-     70,  16,  16,   0,   1,   0, 
-      0,   0,  62,   0,   0,   1, 
-     83,  84,  65,  84, 148,   0, 
-      0,   0,  54,   0,   0,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,  11,   0,   0,   0, 
-     24,   0,   0,   0,   2,   0, 
-      0,   0,   8,   0,   0,   0, 
-      2,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   2,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      6,   0,   0,   0,   2,   0, 
-      0,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0
-};

+ 2 - 0
FactoryCraft/DX11CustomPixelShader.hlsl

@@ -129,6 +129,8 @@ float4 TexturePixelShader(PixelInputType input) : SV_TARGET
         {
             diffuseLight.z = diffuseLight2.z;
         }
+		// use this return to debug dynamic lightning
+		//return float4(input.light2.x, input.light2.y, input.light2.z, 1.0);
 	}
 	else
 	{

+ 1 - 1
FactoryCraft/DX11CustomVertexShader.hlsl

@@ -95,7 +95,7 @@ PixelInputType TextureVertexShader(VertexInputType input)
             dynamicLight = lightBuffer[input.id / 2].dynamicLight2;
         }
     }
-    if (lightLength > 0 && input.id < lightLength)
+    if (lightLength > 0 && (input.id < lightLength || lightLength == 1))
     {
         output.light1.x = (((dayLight >> 24) & 0xFF) / 255.f) * dayLightFactor;
         output.light1.y = (((dayLight >> 16) & 0xFF) / 255.f) * dayLightFactor;

+ 10 - 1
FactoryCraft/Dialog.cpp

@@ -17,6 +17,8 @@
 #include "RecipieIngredient.h"
 #include "RecipieOutput.h"
 #include "ShapedRecipie.h"
+#include "UIMLCraftingProgress.h"
+#include "UIMLFuelState.h"
 #include "UnshapedRecipie.h"
 
 using namespace Framework;
@@ -42,6 +44,8 @@ UIMLDialog::UIMLDialog(
     view->addKnownElement(new QuestGraphElement());
     view->addKnownElement(new QuestGraphItemElement());
     view->addKnownElement(new ItemStackElement());
+    view->addKnownElement(new UIMLCraftingProgressElement());
+    view->addKnownElement(new UIMLFuelStateElement());
     view->setOnMemberMouseEvent([](Framework::XML::Element& element,
                                     Framework::Zeichnung& z,
                                     MausEreignis me) {
@@ -243,7 +247,12 @@ void UIMLDialog::api(char* message)
     id[idLen] = 0;
     NetworkAPIProcessor* processor
         = dynamic_cast<NetworkAPIProcessor*>(view->zZeichnungById(id));
-    if (processor) processor->api(message + 2 + idLen);
+    if (processor
+        && (*(int*)(message + 2 + idLen) == -1 // global message
+            || processor->getId() == *(int*)(message + 2 + idLen)))
+    {
+        processor->api(message + 6 + idLen);
+    }
     delete[] id;
 }
 

+ 14 - 0
FactoryCraft/Dimension.cpp

@@ -164,6 +164,20 @@ void Dimension::api(char* message)
     case 6: // set gravity
         gravity = *(float*)(message + 1);
         break;
+    case 7: // add entity
+        {
+            int type = *(int*)(message + 1);
+            ByteArrayReader reader(message + 5, INT_MAX, 0);
+            Entity* entity = entityTypes[type]->loadEntity(&reader);
+            addEntity(entity);
+            break;
+        }
+    case 8: // remove entity
+        {
+            int id = *(int*)(message + 1);
+            removeEntity(id);
+            break;
+        }
     }
 }
 

+ 1 - 1
FactoryCraft/Entity.cpp

@@ -32,7 +32,7 @@ Entity::Entity(const EntityType* zType,
     lastDirection = World::INSTANCE->zKamera()->getDirection();
     currentFrame.duration = 0;
     rend = 1;
-    lastFlags = 0;
+    lastFlags = MOVEMENT_FLAG_FLY;
     setSize(size);
 }
 

+ 0 - 14
FactoryCraft/EntityRemovedUpdate.cpp

@@ -1,14 +0,0 @@
-#include "EntityRemovedUpdate.h"
-
-#include "Globals.h"
-
-EntityRemovedUpdateType::EntityRemovedUpdateType()
-    : WorldUpdateType(ID)
-{}
-
-void EntityRemovedUpdateType::applyUpdate(Framework::StreamReader* zReader)
-{
-    int id;
-    zReader->lese((char*)&id, 4);
-    World::INSTANCE->removeEntity(id);
-}

+ 0 - 14
FactoryCraft/EntityRemovedUpdate.h

@@ -1,14 +0,0 @@
-#pragma once
-
-#include "WorldUpdate.h"
-
-class EntityRemovedUpdateType : WorldUpdateType
-{
-    REGISTRABLE(EntityRemovedUpdateType)
-
-protected:
-    EntityRemovedUpdateType();
-    void applyUpdate(Framework::StreamReader* zReader) override;
-};
-
-REGISTER(EntityRemovedUpdateType, WorldUpdateType)

+ 0 - 1
FactoryCraft/EntityType.cpp

@@ -2,7 +2,6 @@
 
 #include "Entity.h"
 #include "Globals.h"
-#include "Registries.h"
 
 EntityType::EntityType(int id, ModelInfo model)
     : id(id),

+ 34 - 0
FactoryCraft/FactoryClient.cpp

@@ -395,6 +395,40 @@ void FactoryClient::blockAPIRequest(
     cs.unlock();
 }
 
+void FactoryClient::componentAPIRequest(
+    int* address, int addrLen, const char* message, unsigned short length)
+{
+    if (!foreground) return;
+    cs.lock();
+    short sum = length + addrLen * 4 + (addrLen > 2 ? 3 : 2);
+    foreground->sende((char*)&sum, 2);
+    if (addrLen > 2)
+    {
+        char msgId = 7; // dimension request
+        foreground->sende(&msgId, 1);
+        foreground->sende((char*)&address[0], 4); // dimension id
+        msgId = 1;                                // block request
+        foreground->sende(&msgId, 1);
+        foreground->sende((char*)&address[1], 4); // position x
+        foreground->sende((char*)&address[2], 4); // position y
+        foreground->sende((char*)&address[3], 4); // position z
+        msgId = 2;                                // component request
+        foreground->sende(&msgId, 1);
+        foreground->sende((char*)&address[4], 4); // component index
+    }
+    else
+    {
+        char msgId = 3; // entity request
+        foreground->sende(&msgId, 1);
+        foreground->sende((char*)&address[0], 4); // entity id
+        msgId = 2;                                // component request
+        foreground->sende(&msgId, 1);
+        foreground->sende((char*)&address[1], 4); // component index
+    }
+    foreground->sende(message, length);
+    cs.unlock();
+}
+
 void FactoryClient::blockAPIRequest(
     int dimensionId, Vec3<int> pos, const char* message, unsigned short length)
 {

+ 2 - 0
FactoryCraft/FactoryClient.h

@@ -45,6 +45,8 @@ public:
         int entityId, const char* message, unsigned short length);
     void blockAPIRequest(
         Vec3<int> pos, const char* message, unsigned short length);
+    void componentAPIRequest(
+        int* address, int addrLen, const char* message, unsigned short length);
     void blockAPIRequest(int dimensionId,
         Vec3<int> pos,
         const char* message,

+ 12 - 11
FactoryCraft/FactoryCraft.vcxproj

@@ -34,7 +34,7 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v143</PlatformToolset>
+    <PlatformToolset>v145</PlatformToolset>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -109,7 +109,7 @@
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FANGEN_EXPORTS;annotate#//;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <LanguageStandard>stdcpp20</LanguageStandard>
+      <LanguageStandard>stdcpplatest</LanguageStandard>
       <PreprocessToFile>false</PreprocessToFile>
     </ClCompile>
     <Link>
@@ -173,7 +173,6 @@ copy "..\..\..\..\..\Allgemein\Network\x64\Release\Network.dll" "network.dll"</C
     </CustomBuildStep>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="AddEntityUpdate.cpp" />
     <ClCompile Include="Area.cpp" />
     <ClCompile Include="Block.cpp" />
     <ClCompile Include="BlockAnimation.cpp" />
@@ -196,7 +195,6 @@ copy "..\..\..\..\..\Allgemein\Network\x64\Release\Network.dll" "network.dll"</C
     <ClCompile Include="DimensionMap.cpp" />
     <ClCompile Include="DragElement.cpp" />
     <ClCompile Include="Entity.cpp" />
-    <ClCompile Include="EntityRemovedUpdate.cpp" />
     <ClCompile Include="EntityType.cpp" />
     <ClCompile Include="Equipment.cpp" />
     <ClCompile Include="FactoryClient.cpp" />
@@ -213,6 +211,7 @@ copy "..\..\..\..\..\Allgemein\Network\x64\Release\Network.dll" "network.dll"</C
     <ClCompile Include="Load.cpp" />
     <ClCompile Include="MapOptions.cpp" />
     <ClCompile Include="MapWindow.cpp" />
+    <ClCompile Include="NetworkAPIProcessor.cpp" />
     <ClCompile Include="OptionsWindow.cpp" />
     <ClCompile Include="QuestGraph.cpp" />
     <ClCompile Include="RecipieGroup.cpp" />
@@ -224,16 +223,17 @@ copy "..\..\..\..\..\Allgemein\Network\x64\Release\Network.dll" "network.dll"</C
     <ClCompile Include="ModelInfo.cpp" />
     <ClCompile Include="PlayerKam.cpp" />
     <ClCompile Include="ShapedRecipie.cpp" />
-    <ClCompile Include="StaticInitializerOrder.cpp" />
     <ClCompile Include="StatusBars.cpp" />
     <ClCompile Include="TransparentChunkGroundModel.cpp" />
+    <ClCompile Include="UIMLCraftingProgress.cpp" />
+    <ClCompile Include="UIMLFuelState.cpp" />
+    <ClCompile Include="UIMLProgressAndStateView.cpp" />
     <ClCompile Include="UIMLToolTip.cpp" />
+    <ClCompile Include="UIMLUtils.cpp" />
     <ClCompile Include="UnshapedRecipie.cpp" />
     <ClCompile Include="World.cpp" />
-    <ClCompile Include="WorldUpdate.cpp" />
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="AddEntityUpdate.h" />
     <ClInclude Include="Area.h" />
     <ClInclude Include="Block.h" />
     <ClInclude Include="BlockType.h" />
@@ -257,7 +257,6 @@ copy "..\..\..\..\..\Allgemein\Network\x64\Release\Network.dll" "network.dll"</C
     <ClInclude Include="DragController.h" />
     <ClInclude Include="DragElement.h" />
     <ClInclude Include="Entity.h" />
-    <ClInclude Include="EntityRemovedUpdate.h" />
     <ClInclude Include="EntityType.h" />
     <ClInclude Include="Equipment.h" />
     <ClInclude Include="FactoryClient.h" />
@@ -275,6 +274,7 @@ copy "..\..\..\..\..\Allgemein\Network\x64\Release\Network.dll" "network.dll"</C
     <ClInclude Include="MapOptions.h" />
     <ClInclude Include="MapWindow.h" />
     <ClInclude Include="BlockAnimation.h" />
+    <ClInclude Include="NetworkAPIProcessor.h" />
     <ClInclude Include="OptionsWindow.h" />
     <ClInclude Include="QuestGraph.h" />
     <ClInclude Include="RecipieGroup.h" />
@@ -284,14 +284,15 @@ copy "..\..\..\..\..\Allgemein\Network\x64\Release\Network.dll" "network.dll"</C
     <ClInclude Include="Menu.h" />
     <ClInclude Include="ModelInfo.h" />
     <ClInclude Include="PlayerKam.h" />
-    <ClInclude Include="Registries.h" />
     <ClInclude Include="ShapedRecipie.h" />
-    <ClInclude Include="StaticRegistry.h" />
     <ClInclude Include="StatusBars.h" />
     <ClInclude Include="TransparentChunkGroundModel.h" />
+    <ClInclude Include="UIMLCraftingProgress.h" />
+    <ClInclude Include="UIMLFuelState.h" />
+    <ClInclude Include="UIMLProgressAndStateView.h" />
     <ClInclude Include="UIMLToolTip.h" />
+    <ClInclude Include="UIMLUtils.h" />
     <ClInclude Include="UnshapedRecipie.h" />
-    <ClInclude Include="WorldUpdate.h" />
     <ClInclude Include="World.h" />
   </ItemGroup>
   <ItemGroup>

+ 33 - 30
FactoryCraft/FactoryCraft.vcxproj.filters

@@ -7,9 +7,6 @@
     <Filter Include="world">
       <UniqueIdentifier>{0a3d8693-54b5-4227-ba18-b964b512430b}</UniqueIdentifier>
     </Filter>
-    <Filter Include="world\update">
-      <UniqueIdentifier>{b7be90aa-b378-46eb-90ed-b31d984ff5ce}</UniqueIdentifier>
-    </Filter>
     <Filter Include="inventory">
       <UniqueIdentifier>{dcbc509e-a646-43ea-9b60-9c5e96e3ea34}</UniqueIdentifier>
     </Filter>
@@ -77,6 +74,9 @@
     <Filter Include="Menu\uiml\general">
       <UniqueIdentifier>{64334234-0f45-4fa0-a9a5-b4dedc4e6713}</UniqueIdentifier>
     </Filter>
+    <Filter Include="Menu\uiml\machines">
+      <UniqueIdentifier>{81183509-a39b-4480-8dc1-94e19d69448d}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="Main.cpp">
@@ -91,9 +91,6 @@
     <ClCompile Include="Initialisierung.cpp">
       <Filter>static</Filter>
     </ClCompile>
-    <ClCompile Include="WorldUpdate.cpp">
-      <Filter>world\update</Filter>
-    </ClCompile>
     <ClCompile Include="BlockType.cpp">
       <Filter>world</Filter>
     </ClCompile>
@@ -109,9 +106,6 @@
     <ClCompile Include="Dimension.cpp">
       <Filter>world</Filter>
     </ClCompile>
-    <ClCompile Include="StaticInitializerOrder.cpp">
-      <Filter>static</Filter>
-    </ClCompile>
     <ClCompile Include="PlayerKam.cpp">
       <Filter>world\view</Filter>
     </ClCompile>
@@ -139,12 +133,6 @@
     <ClCompile Include="Entity.cpp">
       <Filter>Entity</Filter>
     </ClCompile>
-    <ClCompile Include="AddEntityUpdate.cpp">
-      <Filter>world\update</Filter>
-    </ClCompile>
-    <ClCompile Include="EntityRemovedUpdate.cpp">
-      <Filter>world\update</Filter>
-    </ClCompile>
     <ClCompile Include="Dialog.cpp">
       <Filter>Menu\uiml</Filter>
     </ClCompile>
@@ -253,6 +241,21 @@
     <ClCompile Include="ItemStack.cpp">
       <Filter>Menu\uiml\quests</Filter>
     </ClCompile>
+    <ClCompile Include="NetworkAPIProcessor.cpp">
+      <Filter>Menu\uiml</Filter>
+    </ClCompile>
+    <ClCompile Include="UIMLCraftingProgress.cpp">
+      <Filter>Menu\uiml\machines</Filter>
+    </ClCompile>
+    <ClCompile Include="UIMLFuelState.cpp">
+      <Filter>Menu\uiml\machines</Filter>
+    </ClCompile>
+    <ClCompile Include="UIMLUtils.cpp">
+      <Filter>Menu\uiml</Filter>
+    </ClCompile>
+    <ClCompile Include="UIMLProgressAndStateView.cpp">
+      <Filter>Menu\uiml\machines</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="Area.h">
@@ -267,9 +270,6 @@
     <ClInclude Include="World.h">
       <Filter>world</Filter>
     </ClInclude>
-    <ClInclude Include="WorldUpdate.h">
-      <Filter>world\update</Filter>
-    </ClInclude>
     <ClInclude Include="Globals.h">
       <Filter>static</Filter>
     </ClInclude>
@@ -285,9 +285,6 @@
     <ClInclude Include="Constants.h">
       <Filter>static</Filter>
     </ClInclude>
-    <ClInclude Include="Registries.h">
-      <Filter>static</Filter>
-    </ClInclude>
     <ClInclude Include="PlayerKam.h">
       <Filter>world\view</Filter>
     </ClInclude>
@@ -315,12 +312,6 @@
     <ClInclude Include="EntityType.h">
       <Filter>Entity</Filter>
     </ClInclude>
-    <ClInclude Include="AddEntityUpdate.h">
-      <Filter>world\update</Filter>
-    </ClInclude>
-    <ClInclude Include="EntityRemovedUpdate.h">
-      <Filter>world\update</Filter>
-    </ClInclude>
     <ClInclude Include="Dialog.h">
       <Filter>Menu\uiml</Filter>
     </ClInclude>
@@ -336,9 +327,6 @@
     <ClInclude Include="ModelInfo.h">
       <Filter>static</Filter>
     </ClInclude>
-    <ClInclude Include="StaticRegistry.h">
-      <Filter>static</Filter>
-    </ClInclude>
     <ClInclude Include="ItemBar.h">
       <Filter>Menu\uiml\playerGUI</Filter>
     </ClInclude>
@@ -435,6 +423,21 @@
     <ClInclude Include="ItemStack.h">
       <Filter>Menu\uiml\quests</Filter>
     </ClInclude>
+    <ClInclude Include="NetworkAPIProcessor.h">
+      <Filter>Menu\uiml</Filter>
+    </ClInclude>
+    <ClInclude Include="UIMLCraftingProgress.h">
+      <Filter>Menu\uiml\machines</Filter>
+    </ClInclude>
+    <ClInclude Include="UIMLFuelState.h">
+      <Filter>Menu\uiml\machines</Filter>
+    </ClInclude>
+    <ClInclude Include="UIMLUtils.h">
+      <Filter>Menu\uiml</Filter>
+    </ClInclude>
+    <ClInclude Include="UIMLProgressAndStateView.h">
+      <Filter>Menu\uiml\machines</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <FxCompile Include="DX11CustomVertexShader.hlsl">

+ 14 - 4
FactoryCraft/FactoryCraftModel.cpp

@@ -18,6 +18,7 @@ FactoryCraftModel::FactoryCraftModel()
         = uiFactory.initParam.bildschirm->zGraphicsApi()->createOrGetTextur(
             "blocks.ltdb/crack.png", 0);
     effectAlpha = 0;
+    memset(averageLight, 0, 8);
 }
 
 FactoryCraftModel::~FactoryCraftModel()
@@ -33,7 +34,6 @@ struct TexturEffect
     float percentage;
 };
 
-
 void FactoryCraftModel::beforeRender(Framework::GraphicsApi* api,
     Framework::Shader* zVertexShader,
     Framework::Shader* zPixelShader)
@@ -54,14 +54,17 @@ void FactoryCraftModel::beforeRender(Framework::GraphicsApi* api,
         }
         else
         {
+            World::INSTANCE->zFallbackVertexLightBuffer()->setData(
+                averageLight);
+            World::INSTANCE->zFallbackVertexLightBuffer()->setChanged();
+            World::INSTANCE->zFallbackVertexLightBuffer()->copieren(8);
             cApi->setVertexLightBuffer(
                 World::INSTANCE->zFallbackVertexLightBuffer());
         }
         if (destroyedState > 0 && effectAlpha)
         {
             TexturEffect e = {1, 1.f + destroyedState};
-            zPixelShader->füllConstBuffer(
-                (char*)&e, 3, sizeof(TexturEffect));
+            zPixelShader->füllConstBuffer((char*)&e, 3, sizeof(TexturEffect));
         }
     }
 }
@@ -145,4 +148,11 @@ Textur* FactoryCraftModel::zEffectTextur()
 float FactoryCraftModel::getEffectPercentage()
 {
     return destroyedState;
-}
+}
+
+void FactoryCraftModel::setAverageLight(unsigned char light[3])
+{
+    *(averageLight + 5) = light[2];
+    *(averageLight + 6) = light[1];
+    *(averageLight + 7) = light[0];
+}

+ 2 - 0
FactoryCraft/FactoryCraftModel.h

@@ -15,6 +15,7 @@ private:
     float destroyedState;
     Framework::Textur* breakTextur;
     bool effectAlpha;
+    unsigned char averageLight[8];
 
 protected:
     void beforeRender(Framework::GraphicsApi* api,
@@ -36,4 +37,5 @@ public:
     bool needRenderPolygon(int index) override;
     Framework::Textur* zEffectTextur() override;
     float getEffectPercentage() override;
+    void setAverageLight(unsigned char light[3]);
 };

+ 6 - 1
FactoryCraft/Game.cpp

@@ -206,7 +206,12 @@ void Game::api(char* data)
             id[idLen] = 0;
             NetworkAPIProcessor* processor = dynamic_cast<NetworkAPIProcessor*>(
                 guiView->zZeichnungById(id));
-            if (processor) processor->api(data + 3 + idLen);
+            int processorId = *(int*)(data + 3 + idLen);
+            if (processor
+                && (processorId == -1 || processorId == processor->getId()))
+            {
+                processor->api(data + 7 + idLen);
+            }
             delete[] id;
             break;
         }

+ 1 - 0
FactoryCraft/Globals.h

@@ -8,6 +8,7 @@
 #include <Schrift.h>
 #include <UIInitialization.h>
 
+#include "ItemType.h"
 #include "Menu.h"
 #include "World.h"
 

+ 14 - 9
FactoryCraft/InventoryView.cpp

@@ -125,6 +125,7 @@ void SlotInfo::render(
 InventoryView::InventoryView(
     Text id, Either<int, VecN<int, 4>> target, int rowSize, Text slotNameFilter)
     : ZeichnungHintergrund(),
+      NetworkAPIProcessor(),
       rowSize(rowSize),
       target(target),
       slotNameFilter(slotNameFilter),
@@ -137,16 +138,17 @@ InventoryView::InventoryView(
 {
     setStyle(ZeichnungHintergrund::Style::Sichtbar
              | ZeichnungHintergrund::Style::Erlaubt);
-    char* msg = new char[id.getLength() + slotNameFilter.getLength() + 3];
+    char* msg = new char[id.getLength() + slotNameFilter.getLength() + 7];
     msg[0] = 0;
     msg[1] = (char)id.getLength();
     memcpy(msg + 2, id.getText(), id.getLength());
-    msg[2 + id.getLength()] = (char)slotNameFilter.getLength();
-    memcpy(msg + 3 + id.getLength(),
+    *(int*)(msg + 2 + id.getLength()) = NetworkAPIProcessor::getId();
+    msg[6 + id.getLength()] = (char)slotNameFilter.getLength();
+    memcpy(msg + 7 + id.getLength(),
         slotNameFilter.getText(),
         slotNameFilter.getLength());
     World::INSTANCE->zClient()->inventoryAPIRequest(
-        target, msg, id.getLength() + slotNameFilter.getLength() + 3);
+        target, msg, id.getLength() + slotNameFilter.getLength() + 7);
     delete[] msg;
     setNeedToolTipEvent([this](Zeichnung* z, Punkt p) {
         int slot = getSlotByLocalPos(p);
@@ -162,13 +164,15 @@ InventoryView::InventoryView(
             {
                 std::cout << "requesting tooltip for slot " << slot << "\n";
                 requestetTooltipSlot = slot;
-                char* msg = new char[this->id.getLength() + 6];
+                char* msg = new char[this->id.getLength() + 10];
                 msg[0] = 2; // request inventory tooltip
                 msg[1] = (char)this->id.getLength();
                 memcpy(msg + 2, this->id.getText(), this->id.getLength());
-                *(int*)(msg + 2 + this->id.getLength()) = slot;
+                *(int*)(msg + 2 + this->id.getLength())
+                    = NetworkAPIProcessor::getId();
+                *(int*)(msg + 6 + this->id.getLength()) = slot;
                 World::INSTANCE->zClient()->inventoryAPIRequest(
-                    this->target, msg, this->id.getLength() + 6);
+                    this->target, msg, this->id.getLength() + 10);
                 return 1;
             }
         }
@@ -182,12 +186,13 @@ InventoryView::~InventoryView()
         = ((Game*)(Menu*)menuRegister->get("game"))->zInventoryDragController();
     if (controller->getCurrentDragContainer() == this) controller->stopDrag();
     if (slots) slots->release();
-    char* msg = new char[id.getLength() + 2];
+    char* msg = new char[id.getLength() + 6];
     msg[0] = 1;
     msg[1] = (char)id.getLength();
     memcpy(msg + 2, id.getText(), id.getLength());
+    *(int*)(msg + 2 + id.getLength()) = NetworkAPIProcessor::getId();
     World::INSTANCE->zClient()->inventoryAPIRequest(
-        target, msg, id.getLength() + 2);
+        target, msg, id.getLength() + 6);
     delete[] msg;
 }
 

+ 9 - 6
FactoryCraft/ItemBar.cpp

@@ -52,6 +52,7 @@ ItemBarView::ItemBarView(Framework::Text id,
     int targetEntity,
     Framework::Text slotNameFilter)
     : ZeichnungHintergrund(),
+      NetworkAPIProcessor(),
       id(id),
       rowSize(rowSize),
       targetEntity(targetEntity),
@@ -59,16 +60,17 @@ ItemBarView::ItemBarView(Framework::Text id,
       slots(0),
       leftHandPos(0)
 {
-    char* msg = new char[id.getLength() + slotNameFilter.getLength() + 3];
+    char* msg = new char[id.getLength() + slotNameFilter.getLength() + 7];
     msg[0] = 0;
     msg[1] = (char)id.getLength();
     memcpy(msg + 2, id.getText(), id.getLength());
-    msg[2 + id.getLength()] = (char)slotNameFilter.getLength();
-    memcpy(msg + 3 + id.getLength(),
+    *(int*)(msg + 2 + id.getLength()) = NetworkAPIProcessor::getId();
+    msg[6 + id.getLength()] = (char)slotNameFilter.getLength();
+    memcpy(msg + 7 + id.getLength(),
         slotNameFilter.getText(),
         slotNameFilter.getLength());
     World::INSTANCE->zClient()->inventoryAPIRequest(
-        targetEntity, msg, id.getLength() + slotNameFilter.getLength() + 3);
+        targetEntity, msg, id.getLength() + slotNameFilter.getLength() + 7);
     World::INSTANCE->zClient()->sendPlayerAction("\x8", 1);
     delete[] msg;
 }
@@ -76,12 +78,13 @@ ItemBarView::ItemBarView(Framework::Text id,
 ItemBarView::~ItemBarView()
 {
     if (slots) slots->release();
-    char* msg = new char[id.getLength() + 2];
+    char* msg = new char[id.getLength() + 6];
     msg[0] = 1;
     msg[1] = (char)id.getLength();
     memcpy(msg + 2, id.getText(), id.getLength());
+    *(int*)(msg + 2 + id.getLength()) = NetworkAPIProcessor::getId();
     World::INSTANCE->zClient()->inventoryAPIRequest(
-        targetEntity, msg, id.getLength() + 2);
+        targetEntity, msg, id.getLength() + 6);
     delete[] msg;
 }
 

+ 0 - 2
FactoryCraft/ItemType.cpp

@@ -3,8 +3,6 @@
 
 #include <InMemoryBuffer.h>
 
-#include "Registries.h"
-
 ItemType::ItemType(
     int id, ModelInfo model, Framework::Text name, Framework::Text tooltipUIML)
     : ReferenceCounter(),

+ 21 - 0
FactoryCraft/NetworkAPIProcessor.cpp

@@ -0,0 +1,21 @@
+#include "NetworkAPIProcessor.h"
+
+int NetworkAPIProcessor::nextId = 0;
+Framework::Critical NetworkAPIProcessor::idLock;
+
+int NetworkAPIProcessor::generateId()
+{
+    idLock.lock();
+    int result = nextId++;
+    idLock.unlock();
+    return result;
+}
+
+NetworkAPIProcessor::NetworkAPIProcessor()
+    : id(generateId())
+{}
+
+int NetworkAPIProcessor::getId() const
+{
+    return id;
+}

+ 12 - 1
FactoryCraft/NetworkAPIProcessor.h

@@ -1,7 +1,18 @@
 #pragma once
 
+#include <Critical.h>
+
 class NetworkAPIProcessor
 {
+    static int nextId;
+    static Framework::Critical idLock;
+
+    static int generateId();
+
+    int id;
+
 public:
-	virtual void api(char* message) = 0;
+    NetworkAPIProcessor();
+    virtual void api(char* message) = 0;
+    int getId() const;
 };

+ 0 - 18
FactoryCraft/Registries.h

@@ -1,18 +0,0 @@
-#pragma once
-
-#include "BlockType.h"
-#include "EntityType.h"
-#include "ItemType.h"
-#include "StaticRegistry.h"
-#include "WorldUpdate.h"
-
-#ifndef _REGISTRY
-#    define _REGISTRY extern
-#endif
-
-#define STATIC_REGISTRY(Type) Type##Registry
-
-_REGISTRY StaticRegistry<WorldUpdateType> WorldUpdateTypeRegistry;
-_REGISTRY StaticRegistry<BlockType> BlockTypeRegistry;
-_REGISTRY StaticRegistry<ItemType> ItemTypeRegistry;
-_REGISTRY StaticRegistry<EntityType> EntityTypeRegistry;

+ 17 - 17
FactoryCraft/ServerSelection.cpp

@@ -4,6 +4,7 @@
 #include <AsynchronCall.h>
 #include <Base64.h>
 #include <Bild.h>
+#include <DataValidator.h>
 #include <Datei.h>
 #include <DateiSystem.h>
 #include <JSON.h>
@@ -374,17 +375,17 @@ ServerSelectionMenu::ServerSelectionMenu(Bildschirm* zScreen)
     if (json)
     {
         // build validator
-        JSON::Validator::JSONValidator* validator
-            = JSON::Validator::JSONValidator::buildForObject()
+        Validator::DataValidator* validator
+            = Validator::DataValidator::buildForObject()
                   ->withRequiredString("playerName")
                   ->withDefault("")
                   ->finishString()
                   ->withRequiredAttribute("server",
-                      JSON::Validator::JSONValidator::buildForArray()
+                      Validator::DataValidator::buildForArray()
                           ->withDefault(new JSON::JSONArray())
                           ->removeInvalidEntries()
                           ->addAcceptedTypeInArray(
-                              JSON::Validator::JSONValidator::buildForObject()
+                              Validator::DataValidator::buildForObject()
                                   ->withRequiredString("name")
                                   ->finishString()
                                   ->withRequiredString("ip")
@@ -398,19 +399,18 @@ ServerSelectionMenu::ServerSelectionMenu(Bildschirm* zScreen)
                                   ->whichIsLessOrEqual((double)0xFFFF)
                                   ->finishNumber()
                                   ->withRequiredAttribute("secrets",
-                                      JSON::Validator::JSONValidator::
-                                          buildForArray()
-                                              ->addAcceptedObjectInArray()
-                                              ->withRequiredString("secret")
-                                              ->finishString()
-                                              ->withRequiredString("playerName")
-                                              ->finishString()
-                                              ->finishObject()
-                                              ->finishArray())
+                                      Validator::DataValidator::buildForArray()
+                                          ->addAcceptedObjectInArray()
+                                          ->withRequiredString("secret")
+                                          ->finishString()
+                                          ->withRequiredString("playerName")
+                                          ->finishString()
+                                          ->finishObject()
+                                          ->finishArray())
                                   ->finishObject())
                           ->finishArray())
                   ->finishObject();
-        RCArray<JSON::Validator::JSONValidationResult> removedParts;
+        RCArray<Validator::ValidationResult> removedParts;
         JSON::JSONValue* validJson
             = validator->getValidParts(json, &removedParts);
         json->release();
@@ -455,9 +455,9 @@ ServerSelectionMenu::ServerSelectionMenu(Bildschirm* zScreen)
                 serverList->addEintrag(s);
             }
             playerName->setText(validJson->asObject()
-                                    ->zValue("playerName")
-                                    ->asString()
-                                    ->getString());
+                    ->zValue("playerName")
+                    ->asString()
+                    ->getString());
             if (playerName->zText()->getLength() > 0)
             {
                 for (int i = 0; i < serverList->getEintragAnzahl(); i++)

+ 0 - 16
FactoryCraft/StaticInitializerOrder.cpp

@@ -1,16 +0,0 @@
-#define _REGISTRY
-
-#include "Registries.h"
-
-int count_WorldUpdateType = 0;
-
-#undef REGISTER
-#define REGISTER(c, typ)             \
-    const int c::ID = count_##typ++; \
-    const c* c::INSTANCE = new c();
-
-// order of includes determines the ids
-
-// world updates
-#include "AddEntityUpdate.h"
-#include "EntityRemovedUpdate.h"

+ 0 - 66
FactoryCraft/StaticRegistry.h

@@ -1,66 +0,0 @@
-#pragma once
-
-#define REGISTRABLE(c)        \
-                              \
-public:                       \
-    static const c* INSTANCE; \
-    static const int ID;      \
-                              \
-private:
-
-#define REGISTER(c, typ)
-
-template<typename T> class StaticRegistry
-{
-private:
-    T** registry;
-    int count;
-
-public:
-    StaticRegistry()
-    {
-        count = 1;
-        registry = new T*[count];
-        memset(registry, 0, sizeof(T*) * count);
-    }
-
-    ~StaticRegistry()
-    {
-        for (int index = 0; index < count; index++)
-        {
-            if (registry[index])
-            {
-                registry[index]->release();
-                registry[index] = 0;
-            }
-        }
-        delete[] registry;
-    }
-
-    void registerT(T* type, int id)
-    {
-        if (id >= count)
-        {
-            T** temp = new T*[id + 1];
-            memcpy(temp, registry, sizeof(T*) * count);
-            memset(temp + count, 0, sizeof(T*) * (id + 1 - count));
-            delete[] registry;
-            registry = temp;
-            count = id + 1;
-        }
-        registry[id] = type;
-    }
-
-    T* zElement(int id)
-    {
-        if (id < 0 || id >= count) return 0;
-        return registry[id];
-    }
-
-    int getCount() const
-    {
-        return count;
-    }
-
-    friend T;
-};

+ 7 - 4
FactoryCraft/StatusBars.cpp

@@ -46,6 +46,7 @@ void StatusBarsElement::layout(Framework::XML::Element& element,
 
 StatusBarsView::StatusBarsView(Framework::Text id, int targetEntity)
     : ZeichnungHintergrund(),
+      NetworkAPIProcessor(),
       id(id),
       targetEntity(targetEntity)
 {
@@ -70,23 +71,25 @@ StatusBarsView::StatusBarsView(Framework::Text id, int targetEntity)
     tr.setSchriftZ(
         dynamic_cast<Schrift*>(uiFactory.initParam.schrift->getThis()));
     tr.setSchriftSize(12);
-    char* msg = new char[id.getLength() + 2];
+    char* msg = new char[id.getLength() + 6];
     msg[0] = 0; // request status bar state
     msg[1] = (char)id.getLength();
     memcpy(msg + 2, id.getText(), id.getLength());
+    *(int*)(msg + 2 + id.getLength()) = NetworkAPIProcessor::getId();
     World::INSTANCE->zClient()->entityAPIRequest(
-        targetEntity, msg, id.getLength() + 2);
+        targetEntity, msg, id.getLength() + 6);
     delete[] msg;
 }
 
 StatusBarsView::~StatusBarsView()
 {
-    char* msg = new char[id.getLength() + 2];
+    char* msg = new char[id.getLength() + 6];
     msg[0] = 1; // remove status bar observer
     msg[1] = (char)id.getLength();
     memcpy(msg + 2, id.getText(), id.getLength());
+    *(int*)(msg + 2 + id.getLength()) = NetworkAPIProcessor::getId();
     World::INSTANCE->zClient()->entityAPIRequest(
-        targetEntity, msg, id.getLength() + 2);
+        targetEntity, msg, id.getLength() + 6);
     delete[] msg;
     healthIcon->release();
     energyIcon->release();

+ 7 - 6
FactoryCraft/TransparentChunkGroundModel.cpp

@@ -1,8 +1,9 @@
+#include "TransparentChunkGroundModel.h"
+
 #include <Trie.h>
 
 #include "Area.h"
 #include "Block.h"
-#include "TransparentChunkGroundModel.h"
 #include "Constants.h"
 #include "FactoryCraftModel.h"
 #include "Globals.h"
@@ -11,7 +12,8 @@ using namespace Framework;
 
 TransparentChunkGroundModel::TransparentChunkGroundModel(
     FactoryCraftModel* target, Chunk* zChunk)
-    : ChunkModelBuilder(target, zChunk, Chunk::CombinedModels::TRANSPARENT_GROUND)
+    : ChunkModelBuilder(
+          target, zChunk, Chunk::CombinedModels::TRANSPARENT_GROUND)
 {}
 
 __int64 TransparentChunkGroundModel::calculateLight(
@@ -110,7 +112,7 @@ void TransparentChunkGroundModel::buildModel()
                 __int64 light = blocks()[i]->getMaxLight();
                 int index = 0;
                 for (Text* textureName :
-                    *blocks()[i]->zBlockType()->getModelInfo().getTexturNames())
+                    *blocks()[i]->getCurrentModelInfo().getTexturNames())
                 {
                     if (!groundModelBuidler.get(
                             *textureName, textureName->getLength()))
@@ -212,7 +214,7 @@ bool TransparentChunkGroundModel::updateLightning()
                 __int64 light = blocks()[i]->getMaxLight();
                 int index = 0;
                 for (Text* textureName :
-                    *blocks()[i]->zBlockType()->getModelInfo().getTexturNames())
+                    *blocks()[i]->getCurrentModelInfo().getTexturNames())
                 {
                     const Vertex3D* vBuffer
                         = blocks()[i]->zModelData()->zVertexBuffer();
@@ -237,6 +239,5 @@ bool TransparentChunkGroundModel::isTransparent() const
 
 bool TransparentChunkGroundModel::isPartOfModel(Block* zBlock) const
 {
-    return zBlock->zBlockType()->getModelInfo().getModelName().istGleich(
-        "grass");
+    return zBlock->getCurrentModelInfo().getModelName().istGleich("grass");
 }

+ 53 - 0
FactoryCraft/UIMLCraftingProgress.cpp

@@ -0,0 +1,53 @@
+#include "UIMLCraftingProgress.h"
+
+#include "Globals.h"
+#include "UIMLProgressAndStateView.h"
+#include "UIMLUtils.h"
+
+UIMLCraftingProgressElement::UIMLCraftingProgressElement()
+    : UIMLElement()
+{}
+
+bool UIMLCraftingProgressElement::isApplicableFor(
+    Framework::XML::Element& element)
+{
+    return element.getName().istGleich("craftingProgress");
+}
+
+Framework::Zeichnung* UIMLCraftingProgressElement::parseElement(
+    Framework::XML::Element& element, Framework::UIMLContainer& generalFactory)
+{
+    int addressLength = 0;
+    int* address = getUIMLTargetAddress(
+        element.getAttributeValue("target"), addressLength);
+    UIMLProgressAndStateView* view
+        = new UIMLProgressAndStateView(element.getAttributeValue("id"),
+            element.getAttributeValue("backgroundImagePath"),
+            element.getAttributeValue("foregroundImagePath"),
+            address,
+            addressLength,
+            1,
+            3,
+            "Progress: ",
+            " ticks");
+    Framework::Text direction = element.getAttributeValue("direction");
+    view->setStyle(UIMLProgressAndStateView::Style::Sichtbar
+                   | UIMLProgressAndStateView::Style::Erlaubt);
+    if (direction.istGleich("TOP") || direction.istGleich("BOTTOM"))
+    {
+        view->addStyle(UIMLProgressAndStateView::Style::Vertical);
+    }
+    if (direction.istGleich("TOP") || direction.istGleich("LEFT"))
+    {
+        view->addStyle(UIMLProgressAndStateView::Style::Reversed);
+    }
+    return view;
+}
+
+bool UIMLCraftingProgressElement::updateElement(
+    Framework::XML::Element& element,
+    Framework::Zeichnung& z,
+    Framework::UIMLContainer& generalFactory)
+{
+    return false; // No update needed for this element
+}

+ 19 - 0
FactoryCraft/UIMLCraftingProgress.h

@@ -0,0 +1,19 @@
+#pragma once
+
+#include <UIMLView.h>
+
+#include "NetworkAPIProcessor.h"
+
+class UIMLCraftingProgressElement : public Framework::UIMLElement
+{
+public:
+    UIMLCraftingProgressElement();
+    //! prüft, ob dieses UIML Element für ein bestimmtes xml Element zuständig
+    bool isApplicableFor(Framework::XML::Element& element) override;
+    //! erstellt eine neue Zeichnung zu einem gegebenen xml Element
+    Framework::Zeichnung* parseElement(Framework::XML::Element& element,
+        Framework::UIMLContainer& generalFactory) override;
+    bool updateElement(Framework::XML::Element& element,
+        Framework::Zeichnung& z,
+        Framework::UIMLContainer& generalFactory) override;
+};

+ 51 - 0
FactoryCraft/UIMLFuelState.cpp

@@ -0,0 +1,51 @@
+#include "UIMLFuelState.h"
+
+#include "Globals.h"
+#include "UIMLProgressAndStateView.h"
+#include "UIMLUtils.h"
+
+UIMLFuelStateElement::UIMLFuelStateElement()
+    : UIMLElement()
+{}
+
+bool UIMLFuelStateElement::isApplicableFor(Framework::XML::Element& element)
+{
+    return element.getName().istGleich("fuelState");
+}
+
+Framework::Zeichnung* UIMLFuelStateElement::parseElement(
+    Framework::XML::Element& element, Framework::UIMLContainer& generalFactory)
+{
+    int addressLength = 0;
+    int* address = getUIMLTargetAddress(
+        element.getAttributeValue("target"), addressLength);
+    UIMLProgressAndStateView* view
+        = new UIMLProgressAndStateView(element.getAttributeValue("id"),
+            element.getAttributeValue("backgroundImagePath"),
+            element.getAttributeValue("foregroundImagePath"),
+            address,
+            addressLength,
+            0,
+            2,
+            "Fuel: ",
+            "");
+    Framework::Text direction = element.getAttributeValue("direction");
+    view->setStyle(UIMLProgressAndStateView::Style::Sichtbar
+                   | UIMLProgressAndStateView::Style::Erlaubt);
+    if (direction.istGleich("TOP") || direction.istGleich("BOTTOM"))
+    {
+        view->addStyle(UIMLProgressAndStateView::Style::Vertical);
+    }
+    if (direction.istGleich("TOP") || direction.istGleich("LEFT"))
+    {
+        view->addStyle(UIMLProgressAndStateView::Style::Reversed);
+    }
+    return view;
+}
+
+bool UIMLFuelStateElement::updateElement(Framework::XML::Element& element,
+    Framework::Zeichnung& z,
+    Framework::UIMLContainer& generalFactory)
+{
+    return false; // No update needed for this element
+}

+ 17 - 0
FactoryCraft/UIMLFuelState.h

@@ -0,0 +1,17 @@
+#pragma once
+
+#include <UIMLView.h>
+
+class UIMLFuelStateElement : public Framework::UIMLElement
+{
+public:
+    UIMLFuelStateElement();
+    //! prüft, ob dieses UIML Element für ein bestimmtes xml Element zuständig
+    bool isApplicableFor(Framework::XML::Element& element) override;
+    //! erstellt eine neue Zeichnung zu einem gegebenen xml Element
+    Framework::Zeichnung* parseElement(Framework::XML::Element& element,
+        Framework::UIMLContainer& generalFactory) override;
+    bool updateElement(Framework::XML::Element& element,
+        Framework::Zeichnung& z,
+        Framework::UIMLContainer& generalFactory) override;
+};

+ 164 - 0
FactoryCraft/UIMLProgressAndStateView.cpp

@@ -0,0 +1,164 @@
+#include "UIMLProgressAndStateView.h"
+
+#include <Bild.h>
+#include <DateiSystem.h>
+#include <TextFeld.h>
+#include <ToolTip.h>
+
+#include "Globals.h"
+
+#undef max
+
+UIMLProgressAndStateView::UIMLProgressAndStateView(Framework::Text id,
+    Framework::Text background,
+    Framework::Text foreground,
+    int* targetAddress,
+    int addressLength,
+    char registerMessage,
+    char unregisterMessage,
+    Framework::Text toolTipPrefix,
+    Framework::Text toolTipSuffix)
+    : Framework::Zeichnung(),
+      NetworkAPIProcessor(),
+      id(id),
+      background(0),
+      foreground(0),
+      registerMessage(registerMessage),
+      unregisterMessage(unregisterMessage),
+      toolTipPrefix(toolTipPrefix),
+      toolTipSuffix(toolTipSuffix),
+      targetAddress(targetAddress),
+      addressLength(addressLength),
+      max(0),
+      current(0)
+{
+    Framework::LTDBDatei file;
+    file.setDatei(
+        background.getTeilText(0, background.positionVon(".ltdb/") + 5));
+    file.leseDaten(0);
+    this->background = file.laden(
+        0, background.getTeilText(background.positionVon(".ltdb/") + 6));
+    file.setDatei(
+        foreground.getTeilText(0, foreground.positionVon(".ltdb/") + 5));
+    file.leseDaten(0);
+    this->foreground = file.laden(
+        0, foreground.getTeilText(foreground.positionVon(".ltdb/") + 6));
+    char* msg = new char[id.getLength() + 6];
+    msg[0] = registerMessage; // register progress/state observer
+    msg[1] = (char)id.getLength();
+    memcpy(msg + 2, id.getText(), id.getLength());
+    *(int*)(msg + 2 + id.getLength()) = NetworkAPIProcessor::getId();
+    World::INSTANCE->zClient()->componentAPIRequest(
+        targetAddress, addressLength, msg, id.getLength() + 6);
+    delete[] msg;
+}
+
+UIMLProgressAndStateView::~UIMLProgressAndStateView()
+{
+    char* msg = new char[id.getLength() + 6];
+    msg[0] = unregisterMessage; // unregister fuel state observer
+    msg[1] = (char)id.getLength();
+    memcpy(msg + 2, id.getText(), id.getLength());
+    *(int*)(msg + 2 + id.getLength()) = NetworkAPIProcessor::getId();
+    World::INSTANCE->zClient()->componentAPIRequest(
+        targetAddress, addressLength, msg, id.getLength() + 6);
+    delete[] msg;
+    if (background)
+    {
+        background->release();
+    }
+    if (foreground)
+    {
+        foreground->release();
+    }
+    delete[] targetAddress;
+}
+
+void UIMLProgressAndStateView::api(char* message)
+{
+    max = *(int*)message;
+    current = *(int*)(message + 4);
+    uiFactory.initParam.bildschirm->lock();
+    lockZeichnung();
+    Framework::Text toolTipText;
+    toolTipText.append() << toolTipPrefix.getText() << current << " / " << max
+                         << toolTipSuffix;
+    if (!toolTip)
+    {
+        setToolTipText(toolTipText,
+            uiFactory.initParam.bildschirm,
+            uiFactory.initParam.schrift);
+    }
+    else
+    {
+        Framework::TextFeld* textField
+            = dynamic_cast<Framework::TextFeld*>(toolTip->zMember(0));
+        if (textField)
+        {
+            textField->setText(toolTipText);
+            textField->setSize(
+                textField->getNeededWidth(), textField->getNeededHeight());
+        }
+        else
+        {
+            setToolTipText(toolTipText,
+                uiFactory.initParam.bildschirm,
+                uiFactory.initParam.schrift);
+        }
+    }
+    toolTip->setRender();
+    rend = 1;
+    unlockZeichnung();
+    uiFactory.initParam.bildschirm->unlock();
+}
+
+void UIMLProgressAndStateView::render(Framework::Bild& rObj)
+{
+    if (hatStyleNicht(Style::Sichtbar)) return;
+    lockZeichnung();
+    if (!rObj.setDrawOptions(pos.x, pos.y, gr.x, gr.y))
+    {
+        unlockZeichnung();
+        return;
+    }
+    Zeichnung::render(rObj);
+    rObj.alphaBild(0, 0, gr.x, gr.y, *background);
+    if (max > 0 && current > 0)
+    {
+        double progrss = (double)current / max;
+        if (hatStyle(Style::Vertical))
+        {
+            int height = (int)(gr.y * progrss);
+            if (hatStyle(Style::Reversed))
+            {
+                if (rObj.setDrawOptions(0, gr.y - height, gr.x, height))
+                {
+                    rObj.alphaBild(0, height - gr.y, gr.x, gr.y, *foreground);
+                    rObj.releaseDrawOptions();
+                }
+            }
+            else
+            {
+                rObj.alphaBild(0, 0, gr.x, height, *foreground);
+            }
+        }
+        else
+        {
+            int width = (int)(gr.x * progrss);
+            if (hatStyle(Style::Reversed))
+            {
+                if (rObj.setDrawOptions(gr.x - width, 0, width, gr.y))
+                {
+                    rObj.alphaBild(width - gr.x, 0, gr.x, gr.y, *foreground);
+                    rObj.releaseDrawOptions();
+                }
+            }
+            else
+            {
+                rObj.alphaBild(0, 0, width, gr.y, *foreground);
+            }
+        }
+    }
+    rObj.releaseDrawOptions();
+    unlockZeichnung();
+}

+ 45 - 0
FactoryCraft/UIMLProgressAndStateView.h

@@ -0,0 +1,45 @@
+#pragma once
+
+#include <Text.h>
+#include <Zeichnung.h>
+
+#include "NetworkAPIProcessor.h"
+
+class UIMLProgressAndStateView : public Framework::Zeichnung,
+                                 public NetworkAPIProcessor
+{
+public:
+    class Style : public Framework::Zeichnung::Style
+    {
+    public:
+        static const __int64 Vertical = 0x100;
+        static const __int64 Reversed = 0x200;
+    };
+
+private:
+    Framework::Text id;
+    Framework::Bild* background;
+    Framework::Bild* foreground;
+    char registerMessage;
+    char unregisterMessage;
+    Framework::Text toolTipPrefix;
+    Framework::Text toolTipSuffix;
+    int* targetAddress;
+    int addressLength;
+    int max;
+    int current;
+
+public:
+    UIMLProgressAndStateView(Framework::Text id,
+        Framework::Text background,
+        Framework::Text foreground,
+        int* targetAddress,
+        int addressLength,
+        char registerMessage,
+        char unregisterMessage,
+        Framework::Text toolTipPrefix,
+        Framework::Text toolTipSuffix);
+    ~UIMLProgressAndStateView();
+    void api(char* message) override;
+    void render(Framework::Bild& rObj) override;
+};

+ 66 - 0
FactoryCraft/UIMLUtils.cpp

@@ -0,0 +1,66 @@
+#include "UIMLUtils.h"
+
+int* getUIMLTargetAddress(Framework::Text address, int& addressLength)
+{
+    int* result = 0;
+    if (address.hat(','))
+    {
+        Framework::Text* part1
+            = address.getTeilText(0, address.positionVon(",", 0) + 1);
+        Framework::Text* part2 = address.getTeilText(
+            address.positionVon(",", 0) + 1, address.positionVon(",", 1));
+        Framework::Text* part3 = address.getTeilText(
+            address.positionVon(",", 1) + 1, address.positionVon(",", 2));
+        if (address.hat(":"))
+        {
+            Framework::Text* part4 = address.getTeilText(
+                address.positionVon(",", 2) + 1, address.positionVon(":"));
+            Framework::Text* part5
+                = address.getTeilText(address.positionVon(":") + 1);
+            addressLength = 5;
+            result = new int[5];
+            result[4] = (int)*part5;
+            result[3] = (int)*part4;
+            part5->release();
+            part4->release();
+        }
+        else
+        {
+            Framework::Text* part4
+                = address.getTeilText(address.positionVon(",", 2) + 1);
+            addressLength = 4;
+            result = new int[4];
+            result[3] = (int)*part4;
+            part4->release();
+        }
+        result[0] = (int)*part1;
+        result[1] = (int)*part2;
+        result[2] = (int)*part3;
+        part1->release();
+        part2->release();
+        part3->release();
+    }
+    else
+    {
+        if (address.hat(":"))
+        {
+            Framework::Text* part1
+                = address.getTeilText(0, address.positionVon(":"));
+            Framework::Text* part2
+                = address.getTeilText(address.positionVon(":") + 1);
+            addressLength = 2;
+            result = new int[2];
+            result[0] = (int)*part1;
+            result[1] = (int)*part2;
+            part1->release();
+            part2->release();
+        }
+        else
+        {
+            addressLength = 1;
+            result = new int[1];
+            result[0] = (int)address;
+        }
+    }
+    return result;
+}

+ 5 - 0
FactoryCraft/UIMLUtils.h

@@ -0,0 +1,5 @@
+#pragma once
+
+#include <Text.h>
+
+int* getUIMLTargetAddress(Framework::Text address, int& addressLength);

+ 27 - 26
FactoryCraft/World.cpp

@@ -10,8 +10,6 @@
 #include "Constants.h"
 #include "Game.h"
 #include "Globals.h"
-#include "Registries.h"
-#include "WorldUpdate.h"
 
 using namespace Network;
 using namespace Framework;
@@ -52,6 +50,8 @@ World::World(Bildschirm3D* zScreen, FactoryClient* client)
     selectionModel->setModelDaten(zScreen->zGraphicsApi()->getModel("cube"));
     selectionModel->setSize(1.005f);
     selectionModel->setVisible(0);
+    unsigned char light[3] = {0xff, 0xff, 0xff};
+    selectionModel->setAverageLight(light);
     selectionModel->setModelTextur(new Model3DTextur());
     for (int i = 0; i < 6; i++)
     {
@@ -84,14 +84,6 @@ void World::update(bool background)
                : serverMessageReader = client->getNextForegroundMessage())
     {
         serverMessageReader->lese((char*)&type, 1);
-        if (type == 2) // WORLD UPDATE
-        {
-            int id = 0;
-            serverMessageReader->lese((char*)&id, 4);
-            STATIC_REGISTRY(WorldUpdateType)
-                .zElement(id)
-                ->applyUpdateAndCheck(serverMessageReader);
-        }
         if (type == 3) // API MESSAGE
         {
             int length;
@@ -122,23 +114,32 @@ void World::update(bool background)
                             ->setTargetUIML("");
                         break;
                     case 1:
-                        setTarget(zEntity(*(int*)(data + 2)));
-                        ((Game*)(Menu*)menuRegister->get("game"))
-                            ->setTargetUIML("");
-                        break;
+                        {
+                            setTarget(zEntity(*(int*)(data + 2)));
+                            short len = *(short*)(data + 6);
+                            char* uiml = new char[len + 8];
+                            memcpy(uiml, data + 8, len);
+                            uiml[len] = 0;
+                            ((Game*)(Menu*)menuRegister->get("game"))
+                                ->setTargetUIML(uiml);
+                            delete[] uiml;
+                            break;
+                        }
                     case 2:
-                        setTarget(zBlockAt(Vec3<int>(*(int*)(data + 2),
-                            *(int*)(data + 6),
-                            *(int*)(data + 10))));
-                        int side = *(int*)(data + 14);
-                        short len = *(short*)(data + 18);
-                        char* uiml = new char[len + 1];
-                        memcpy(uiml, data + 20, len);
-                        uiml[len] = 0;
-                        ((Game*)(Menu*)menuRegister->get("game"))
-                            ->setTargetUIML(uiml);
-                        delete[] uiml;
-                        break;
+                        {
+                            setTarget(zBlockAt(Vec3<int>(*(int*)(data + 2),
+                                *(int*)(data + 6),
+                                *(int*)(data + 10))));
+                            int side = *(int*)(data + 14);
+                            short len = *(short*)(data + 18);
+                            char* uiml = new char[len + 1];
+                            memcpy(uiml, data + 20, len);
+                            uiml[len] = 0;
+                            ((Game*)(Menu*)menuRegister->get("game"))
+                                ->setTargetUIML(uiml);
+                            delete[] uiml;
+                            break;
+                        }
                     }
                     break;
                 }

+ 0 - 28
FactoryCraft/WorldUpdate.cpp

@@ -1,28 +0,0 @@
-#include "WorldUpdate.h"
-
-#include <Text.h>
-
-#include "Registries.h"
-
-WorldUpdateType::WorldUpdateType(int id)
-    : ReferenceCounter(),
-      id(id)
-{
-    STATIC_REGISTRY(WorldUpdateType).registerT(this, id);
-}
-
-void WorldUpdateType::applyUpdateAndCheck(Framework::StreamReader* zReader)
-{
-    this->applyUpdate(zReader);
-    int id;
-    zReader->lese((char*)&id, 4);
-    if (id != this->id)
-    {
-        Framework::Text* t
-            = new Framework::Text("asynchony after world update of type ");
-        t->append(this->id);
-        t->append(". ID received from server was: ");
-        t->append(id);
-        throw t->getText();
-    }
-}

+ 0 - 19
FactoryCraft/WorldUpdate.h

@@ -1,19 +0,0 @@
-#pragma once
-
-#include <Reader.h>
-#include <ReferenceCounter.h>
-
-#include "StaticRegistry.h"
-
-class WorldUpdateType : public Framework::ReferenceCounter
-{
-private:
-    int id;
-
-protected:
-    WorldUpdateType(int id);
-    virtual void applyUpdate(Framework::StreamReader* zReader) = 0;
-
-public:
-    void applyUpdateAndCheck(Framework::StreamReader* zReader);
-};

BIN
FactoryCraft/data_release/bilder/gui_icons.ltdb


BIN
FactoryCraft/data_release/models/items.m3


BIN
FactoryCraft/data_release/models/plants.m3


BIN
FactoryCraft/data_release/textures/items.ltdb


BIN
FactoryCraft/data_release/textures/plants.ltdb


BIN
FactoryCraft/error_core_memory_dump.dmp