Browse Source

add fluids

Kolja Strohm 2 years ago
parent
commit
0e204830ac

+ 17 - 1
FactoryCraft/Block.cpp

@@ -85,6 +85,22 @@ void Block::api(char* message)
             setModelTextur(info.getTexture());
             break;
         }
+    case 2: // update fluid fill state
+        {
+            short fluidAmount = *(short*)(message + 1);
+            if (this->skelett)
+            {
+                float z = (float)fluidAmount / 1000.f;
+                Knochen* k = this->skelett->zKnochen()->zKind();
+                k->setPosition(Vec3<float>(0.f, 0.f, z - 1));
+                k = k->zGeschwister();
+                k->setPosition(Vec3<float>(0.f, 0.f, z - 1));
+                k = k->zGeschwister();
+                k->setPosition(Vec3<float>(0.f, 0.f, z - 1));
+                k = k->zGeschwister();
+                k->setPosition(Vec3<float>(0.f, 0.f, z - 1));
+            }
+        }
     }
 }
 
@@ -122,7 +138,7 @@ void Block::setLightData(Direction dir, unsigned char* data)
             *(int*)(lightBuffer + i * 4) = l;
         }
     }
-    else
+    else if (dir == Direction::TOP)
     {
         Vec3<unsigned char> light = Vec3<unsigned char>(
             max((unsigned char)((float)data[0] * dayLightFactor), data[3]),

+ 12 - 3
FactoryCraft/BlockType.cpp

@@ -5,13 +5,17 @@
 
 using namespace Framework;
 
-BlockType::BlockType(
-    int id, bool needsInstance, ModelInfo model, int initialMaxHP)
+BlockType::BlockType(int id,
+    bool needsInstance,
+    ModelInfo model,
+    int initialMaxHP,
+    bool needModelSubscription)
     : ReferenceCounter(),
       id(id),
       needsInstance(needsInstance),
       model(model),
-      initialMaxHP(initialMaxHP)
+      initialMaxHP(initialMaxHP),
+      needModelSubscription(needModelSubscription)
 {}
 
 BlockType::~BlockType() {}
@@ -34,4 +38,9 @@ int BlockType::getId() const
 bool BlockType::doesNeedInstance() const
 {
     return needsInstance;
+}
+
+bool BlockType::doesNeedModelSubscription() const
+{
+    return needModelSubscription;
 }

+ 7 - 1
FactoryCraft/BlockType.h

@@ -15,13 +15,19 @@ private:
     const int id;
     bool needsInstance;
     int initialMaxHP;
+    bool needModelSubscription;
     ModelInfo model;
 
 public:
-    BlockType(int id, bool needsInstance, ModelInfo model, int initialMaxHP);
+    BlockType(int id,
+        bool needsInstance,
+        ModelInfo model,
+        int initialMaxHP,
+        bool needModelSubscription);
     ~BlockType();
     Block* createBlock(Framework::Vec3<int> position);
     bool doesNeedInstance() const;
+    bool doesNeedModelSubscription() const;
 
     int getId() const;
 };

+ 4 - 0
FactoryCraft/Chunk.cpp

@@ -179,6 +179,10 @@ void Chunk::setBlock(Block* block)
         }
     }
     blocks.add(block);
+    if (block->isVisible())
+    {
+        visibleBlocks.add(block);
+    }
     cs.unlock();
 }
 

+ 129 - 129
FactoryCraft/CustomUIDX11PixelShader.h

@@ -257,10 +257,10 @@ ret
 
 const BYTE CustomUIDX11PixelShader[] =
 {
-     68,  88,  66,  67, 117,  27, 
-     31, 230, 152, 230, 254, 225, 
-     18, 134,  62,  35,  63, 119, 
-    190,  52,   1,   0,   0,   0, 
+     68,  88,  66,  67, 197,   6, 
+    239,  11,  53,  97,  41, 209, 
+     55, 209, 192, 158, 235, 232, 
+    171,   2,   1,   0,   0,   0, 
     164, 118,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
     252,   4,   0,   0, 164,   5, 
@@ -1394,11 +1394,11 @@ const BYTE CustomUIDX11PixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0, 148,  46, 
-     49,   1,  99,  87,  18,  99, 
-      1,   0,   0,   0,  19, 178, 
-    231, 123, 191, 187, 192,  66, 
-    176,  94,  90, 191,  84, 189, 
-     75, 207,   0,   0,   0,   0, 
+     49,   1, 105, 229,  58,  99, 
+      1,   0,   0,   0, 225, 180, 
+     79, 168, 156, 248,  50,  73, 
+    160, 210,  69,  43,  25,  10, 
+      5,  21,   0,   0,   0,   0, 
       0,   0,   0,   0,   1,   0, 
       0,   0,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -1569,10 +1569,10 @@ const BYTE CustomUIDX11PixelShader[] =
       3,   0, 194,  82,   1,   0, 
      43, 236,   3,   0,  28,  19, 
       2,   0,  65,  36,   1,   0, 
-    236, 179,   1,   0,  65,  92, 
-      2,   0, 125,  10,   2,   0, 
-    125, 181,   2,   0,  51, 210, 
-      3,   0, 193,  33,   3,   0, 
+    236, 179,   1,   0, 121, 222, 
+      0,   0, 125,  10,   2,   0, 
+    125, 181,   2,   0, 255,  82, 
+      1,   0, 193,  33,   3,   0, 
      65, 185,   2,   0, 146, 230, 
       3,   0,  53, 174,   3,   0, 
     118,  19,   1,   0,  98, 163, 
@@ -2589,8 +2589,8 @@ const BYTE CustomUIDX11PixelShader[] =
      32,  32,  32,  32,  32,  32, 
      32,  32,  32,  32,  32,  32, 
      32,  32,  27, 226,  48,   1, 
-    128,   0,   0,   0, 244, 140, 
-    162,   0,   1, 191, 216,   1, 
+    128,   0,   0,   0, 249, 123, 
+    244,  43,  45, 215, 216,   1, 
       1,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2676,9 +2676,9 @@ const BYTE CustomUIDX11PixelShader[] =
       0,   0,   0,   0,   4,   0, 
       0,   0,  66,   0,  60,  17, 
      16,   1,   0,   0,   0,   1, 
-     10,   0,   1,   0,   1,   0, 
-     93,  88,  10,   0,   1,   0, 
-      1,   0,  93,  88,  77, 105, 
+     10,   0,   1,   0, 173,   2, 
+     97,  74,  10,   0,   1,   0, 
+    173,   2,  97,  74,  77, 105, 
      99, 114, 111, 115, 111, 102, 
     116,  32,  40,  82,  41,  32, 
      72,  76,  83,  76,  32,  83, 
@@ -3579,14 +3579,14 @@ const BYTE CustomUIDX11PixelShader[] =
       0,   0,  23,   0,   1,   0, 
       5,  16,   0,   0,  14,   0, 
      23,  21,   0,  16,   0,   0, 
-      3,   2, 208, 163,   0,   0, 
+      3,   2, 128, 164,   0,   0, 
     242, 241,  10,   0,  24,  21, 
       8,  16,   0,   0,   1,   0, 
       1,   0,  10,   0,  24,  21, 
       9,  16,   0,   0,   1,   0, 
       0,   2,  14,   0,  23,  21, 
       0,   0,   0,   0,  10,   2, 
-    208, 163,   0,   0, 242, 241, 
+    128, 164,   0,   0, 242, 241, 
      10,   0,  24,  21,  11,  16, 
       0,   0,   1,   0,   1,   0, 
      10,   0,  24,  21,  12,  16, 
@@ -4807,76 +4807,59 @@ const BYTE CustomUIDX11PixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    255, 255, 255, 255, 119,   9, 
-     49,   1,   1,   0,   0,   0, 
-     13,   0,  20, 142,  14,   0, 
-     20, 107,  15,   0,   1,   0, 
-     88,   0,   0,   0,  32,   0, 
-      0,   0,  44,   0,   0,   0, 
-    144,   0,   0,   0,   0,   0, 
+    148,  46,  49,   1, 105, 229, 
+     58,  99,   1,   0,   0,   0, 
+    225, 180,  79, 168, 156, 248, 
+     50,  73, 160, 210,  69,  43, 
+     25,  10,   5,  21, 174,   0, 
+      0,   0,  47,  76, 105, 110, 
+    107,  73, 110, 102, 111,   0, 
+     47, 110,  97, 109, 101, 115, 
+      0,  47, 115, 114,  99,  47, 
+    104, 101,  97, 100, 101, 114, 
+     98, 108, 111,  99, 107,   0, 
+     47, 115, 114,  99,  47, 102, 
+    105, 108, 101, 115,  47,  99, 
+     58,  92, 117, 115, 101, 114, 
+    115,  92, 107, 111, 108, 106, 
+     97,  92, 100, 101, 115, 107, 
+    116, 111, 112,  92, 107, 111, 
+    108, 106,  97,  45, 115, 116, 
+    114, 111, 104, 109,  45, 103, 
+     97, 109, 101, 115,  92, 115, 
+    112, 105, 101, 108, 101,  32, 
+    112, 108,  97, 116, 102, 111, 
+    114, 109,  92, 115, 116,  97, 
+    110, 100,  97, 108, 111, 119, 
+    110,  92, 107, 108, 105, 101, 
+    110, 116,  92, 102,  97,  99, 
+    116, 111, 114, 121,  99, 114, 
+     97, 102, 116,  92, 102,  97, 
+     99, 116, 111, 114, 121,  99, 
+    114,  97, 102, 116,  92, 100, 
+    120,  49,  49,  99, 117, 115, 
+    116, 111, 109, 112, 105, 120, 
+    101, 108, 115, 104,  97, 100, 
+    101, 114,  46, 104, 108, 115, 
+    108,   0,   4,   0,   0,   0, 
+      6,   0,   0,   0,   1,   0, 
+      0,   0,  58,   0,   0,   0, 
+      0,   0,   0,   0,  17,   0, 
+      0,   0,   7,   0,   0,   0, 
+     10,   0,   0,   0,   6,   0, 
       0,   0,   0,   0,   0,   0, 
-     22,   0,   0,   0,  25,   0, 
+      5,   0,   0,   0,  34,   0, 
+      0,   0,   8,   0,   0,   0, 
+      0,   0,   0,   0, 220,  81, 
+     51,   1,   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,  32,  10, 
-      0,   0,  32,   0,   0,  96, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      2,   0,   9,   0,  76,   7, 
       0,   0,   0,   0,   0,   0, 
-    100,   9,   0,   0,   1,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,  84, 101, 120, 116, 
-    117, 114, 101,  80, 105, 120, 
-    101, 108,  83, 104,  97, 100, 
-    101, 114,   0, 110, 111, 110, 
-    101,   0,  45, 186,  46, 241, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,  32,  10,   0,   0, 
-     32,   0,   0,  96,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   2,   0, 
-      2,   0,   7,   0,   0,   0, 
-      0,   0,   1,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-     32,  10,   0,   0,   8,   2, 
-      0,   0,   0,   0,   0,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0, 255, 255, 255, 255, 
-      1,   0,   1,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-     67,  58,  92,  85, 115, 101, 
-    114, 115,  92, 107, 111, 108, 
-    106,  97,  92,  68, 101, 115, 
-    107, 116, 111, 112,  92,  75, 
-    111, 108, 106,  97,  45,  83, 
-    116, 114, 111, 104, 109,  45, 
-     71,  97, 109, 101, 115,  92, 
-     83, 112, 105, 101, 108, 101, 
-     32,  80, 108,  97, 116, 102, 
-    111, 114, 109,  92,  83, 116, 
-     97, 110, 100,  97, 108, 111, 
-    119, 110,  92,  75, 108, 105, 
-    101, 110, 116,  92,  70,  97, 
-     99, 116, 111, 114, 121,  67, 
-    114,  97, 102, 116,  92,  70, 
-     97,  99, 116, 111, 114, 121, 
-     67, 114,  97, 102, 116,  92, 
-     68,  88,  49,  49,  67, 117, 
-    115, 116, 111, 109,  80, 105, 
-    120, 101, 108,  83, 104,  97, 
-    100, 101, 114,  46, 104, 108, 
-    115, 108,   0,   0,   0,   0, 
-    254, 239, 254, 239,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   1,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0, 255, 255, 255, 255, 255, 
-    255, 255, 255, 255, 255,  12, 
-      0, 255, 255, 255, 255, 255, 
-    255, 255, 255, 255, 255,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -4891,52 +4874,6 @@ const BYTE CustomUIDX11PixelShader[] =
       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, 148,  46,  49,   1, 
-     99,  87,  18,  99,   1,   0, 
-      0,   0,  19, 178, 231, 123, 
-    191, 187, 192,  66, 176,  94, 
-     90, 191,  84, 189,  75, 207, 
-    174,   0,   0,   0,  47,  76, 
-    105, 110, 107,  73, 110, 102, 
-    111,   0,  47, 110,  97, 109, 
-    101, 115,   0,  47, 115, 114, 
-     99,  47, 104, 101,  97, 100, 
-    101, 114,  98, 108, 111,  99, 
-    107,   0,  47, 115, 114,  99, 
-     47, 102, 105, 108, 101, 115, 
-     47,  99,  58,  92, 117, 115, 
-    101, 114, 115,  92, 107, 111, 
-    108, 106,  97,  92, 100, 101, 
-    115, 107, 116, 111, 112,  92, 
-    107, 111, 108, 106,  97,  45, 
-    115, 116, 114, 111, 104, 109, 
-     45, 103,  97, 109, 101, 115, 
-     92, 115, 112, 105, 101, 108, 
-    101,  32, 112, 108,  97, 116, 
-    102, 111, 114, 109,  92, 115, 
-    116,  97, 110, 100,  97, 108, 
-    111, 119, 110,  92, 107, 108, 
-    105, 101, 110, 116,  92, 102, 
-     97,  99, 116, 111, 114, 121, 
-     99, 114,  97, 102, 116,  92, 
-    102,  97,  99, 116, 111, 114, 
-    121,  99, 114,  97, 102, 116, 
-     92, 100, 120,  49,  49,  99, 
-    117, 115, 116, 111, 109, 112, 
-    105, 120, 101, 108, 115, 104, 
-     97, 100, 101, 114,  46, 104, 
-    108, 115, 108,   0,   4,   0, 
-      0,   0,   6,   0,   0,   0, 
-      1,   0,   0,   0,  58,   0, 
-      0,   0,   0,   0,   0,   0, 
-     17,   0,   0,   0,   7,   0, 
-      0,   0,  10,   0,   0,   0, 
-      6,   0,   0,   0,   0,   0, 
-      0,   0,   5,   0,   0,   0, 
-     34,   0,   0,   0,   8,   0, 
-      0,   0,   0,   0,   0,   0, 
-    220,  81,  51,   1,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -4955,14 +4892,77 @@ const BYTE CustomUIDX11PixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0, 255, 255, 255, 255, 
+    119,   9,  49,   1,   1,   0, 
+      0,   0,  13,   0,   0, 142, 
+     14,   0,  63,  92,  15,   0, 
+      0,   0,  88,   0,   0,   0, 
+     32,   0,   0,   0,  44,   0, 
+      0,   0, 144,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,  22,   0,   0,   0, 
+     25,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,   1,   0, 
       0,   0,   0,   0,   0,   0, 
+     32,  10,   0,   0,  32,   0, 
+      0,  96,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   2,   0,   9,   0, 
+     76,   7,   0,   0,   0,   0, 
+      0,   0, 100,   9,   0,   0, 
+      1,   0, 234,  33,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,  84, 101, 
+    120, 116, 117, 114, 101,  80, 
+    105, 120, 101, 108,  83, 104, 
+     97, 100, 101, 114,   0, 110, 
+    111, 110, 101,   0,  45, 186, 
+     46, 241,   1,   0,   0,   0, 
+      0,   0,   0,   0,  32,  10, 
+      0,   0,  32,   0,   0,  96, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      2,   0,   2,   0,   7,   0, 
+      0,   0,   0,   0,   1,   0, 
+    255, 255, 255, 255,   0,   0, 
+      0,   0,  32,  10,   0,   0, 
+      8,   2,   0,   0,   0,   0, 
+      0,   0, 255, 255, 255, 255, 
+      0,   0,   0,   0, 255, 255, 
+    255, 255,   1,   0,   1,   0, 
+      0,   0,   1,   0,   0,   0, 
+      0,   0,  67,  58,  92,  85, 
+    115, 101, 114, 115,  92, 107, 
+    111, 108, 106,  97,  92,  68, 
+    101, 115, 107, 116, 111, 112, 
+     92,  75, 111, 108, 106,  97, 
+     45,  83, 116, 114, 111, 104, 
+    109,  45,  71,  97, 109, 101, 
+    115,  92,  83, 112, 105, 101, 
+    108, 101,  32,  80, 108,  97, 
+    116, 102, 111, 114, 109,  92, 
+     83, 116,  97, 110, 100,  97, 
+    108, 111, 119, 110,  92,  75, 
+    108, 105, 101, 110, 116,  92, 
+     70,  97,  99, 116, 111, 114, 
+    121,  67, 114,  97, 102, 116, 
+     92,  70,  97,  99, 116, 111, 
+    114, 121,  67, 114,  97, 102, 
+    116,  92,  68,  88,  49,  49, 
+     67, 117, 115, 116, 111, 109, 
+     80, 105, 120, 101, 108,  83, 
+    104,  97, 100, 101, 114,  46, 
+    104, 108, 115, 108,   0,   0, 
+      0,   0, 254, 239, 254, 239, 
+      1,   0,   0,   0,   1,   0, 
+      0,   0,   0,   1,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   0, 255, 255, 255, 
+    255, 255, 255, 255, 255, 255, 
+    255,  12,   0, 255, 255, 255, 
+    255, 255, 255, 255, 255, 255, 
+    255,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -4989,9 +4989,9 @@ const BYTE CustomUIDX11PixelShader[] =
       0,   0,  40,   0,   0,   0, 
     152,   2,   0,   0,  44,   0, 
       0,   0, 148,   1,   0,   0, 
-      3,   0,   0,   0,  46,   0, 
+      3,   0,   0,   0,  45,   0, 
       0,   0,  30,   0,   0,   0, 
-     29,   0,   0,   0,  45,   0, 
+     29,   0,   0,   0,  46,   0, 
       0,   0,  31,   0,   0,   0, 
      18,   0,   0,   0,   6,   0, 
       0,   0,  32,   0,   0,   0, 

+ 122 - 122
FactoryCraft/CustomUIDX11VertexShader.h

@@ -237,10 +237,10 @@ ret
 
 const BYTE CustomUIDX11VertexShader[] =
 {
-     68,  88,  66,  67,  92, 137, 
-     81,  66,  43,  68, 115, 189, 
-     25,  53, 111, 114,  34,  49, 
-     34,  70,   1,   0,   0,   0, 
+     68,  88,  66,  67, 245, 162, 
+    230,  45, 253, 180, 101, 119, 
+    241, 152, 124,  55,  96, 243, 
+    158,  36,   1,   0,   0,   0, 
     216,  93,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
      84,   3,   0,   0,  12,   4, 
@@ -1340,11 +1340,11 @@ const BYTE CustomUIDX11VertexShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0, 148,  46, 
-     49,   1,  99,  87,  18,  99, 
-      1,   0,   0,   0, 102, 225, 
-     45, 108,  95,  87, 214,  75, 
-    171,  78,  55, 217, 174, 146, 
-    233, 109,   0,   0,   0,   0, 
+     49,   1, 106, 229,  58,  99, 
+      1,   0,   0,   0, 233,  51, 
+    103, 241, 206, 208, 140,  64, 
+    157, 247, 151, 110, 136,  72, 
+     83, 186,   0,   0,   0,   0, 
       0,   0,   0,   0,   1,   0, 
       0,   0,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2109,7 +2109,7 @@ const BYTE CustomUIDX11VertexShader[] =
     105, 111, 110,  59,  13,  10, 
     125,  13,  10,  13,  27, 226, 
      48,   1, 128,   0,   0,   0, 
-    178,  26, 238,   0,   1, 191, 
+    159, 232,  38,  44,  45, 215, 
     216,   1,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2196,8 +2196,8 @@ const BYTE CustomUIDX11VertexShader[] =
       4,   0,   0,   0,  66,   0, 
      60,  17,  16,   1,   0,   0, 
       0,   1,  10,   0,   1,   0, 
-      1,   0,  93,  88,  10,   0, 
-      1,   0,   1,   0,  93,  88, 
+    173,   2,  97,  74,  10,   0, 
+      1,   0, 173,   2,  97,  74, 
      77, 105,  99, 114, 111, 115, 
     111, 102, 116,  32,  40,  82, 
      41,  32,  72,  76,  83,  76, 
@@ -3899,78 +3899,61 @@ const BYTE CustomUIDX11VertexShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255, 119,   9,  49,   1, 
-      1,   0,   0,   0,  13,   0, 
-     20, 142,  14,   0,  20, 107, 
-     15,   0,   1,   0,  92,   0, 
-      0,   0,  32,   0,   0,   0, 
-     44,   0,   0,   0, 144,   0, 
+      0,   0,   0,   0, 148,  46, 
+     49,   1, 106, 229,  58,  99, 
+      1,   0,   0,   0, 233,  51, 
+    103, 241, 206, 208, 140,  64, 
+    157, 247, 151, 110, 136,  72, 
+     83, 186, 175,   0,   0,   0, 
+     47,  76, 105, 110, 107,  73, 
+    110, 102, 111,   0,  47, 110, 
+     97, 109, 101, 115,   0,  47, 
+    115, 114,  99,  47, 104, 101, 
+     97, 100, 101, 114,  98, 108, 
+    111,  99, 107,   0,  47, 115, 
+    114,  99,  47, 102, 105, 108, 
+    101, 115,  47,  99,  58,  92, 
+    117, 115, 101, 114, 115,  92, 
+    107, 111, 108, 106,  97,  92, 
+    100, 101, 115, 107, 116, 111, 
+    112,  92, 107, 111, 108, 106, 
+     97,  45, 115, 116, 114, 111, 
+    104, 109,  45, 103,  97, 109, 
+    101, 115,  92, 115, 112, 105, 
+    101, 108, 101,  32, 112, 108, 
+     97, 116, 102, 111, 114, 109, 
+     92, 115, 116,  97, 110, 100, 
+     97, 108, 111, 119, 110,  92, 
+    107, 108, 105, 101, 110, 116, 
+     92, 102,  97,  99, 116, 111, 
+    114, 121,  99, 114,  97, 102, 
+    116,  92, 102,  97,  99, 116, 
+    111, 114, 121,  99, 114,  97, 
+    102, 116,  92, 100, 120,  49, 
+     49,  99, 117, 115, 116, 111, 
+    109, 118, 101, 114, 116, 101, 
+    120, 115, 104,  97, 100, 101, 
+    114,  46, 104, 108, 115, 108, 
+      0,   4,   0,   0,   0,   6, 
+      0,   0,   0,   1,   0,   0, 
+      0,  30,   0,   0,   0,   0, 
+      0,   0,   0,  17,   0,   0, 
+      0,   7,   0,   0,   0,  34, 
+      0,   0,   0,   8,   0,   0, 
+      0,  10,   0,   0,   0,   6, 
+      0,   0,   0,   0,   0,   0, 
+      0,   5,   0,   0,   0,   0, 
+      0,   0,   0, 220,  81,  51, 
+      1,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  22,   0, 
-      0,   0,  25,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0, 120,  10,   0,   0, 
-     32,   0,   0,  96,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   2,   0, 
-      9,   0,  64,   6,   0,   0, 
-      0,   0,   0,   0, 236,   8, 
-      0,   0,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-     84, 101, 120, 116, 117, 114, 
-    101,  86, 101, 114, 116, 101, 
-    120,  83, 104,  97, 100, 101, 
-    114,   0, 110, 111, 110, 101, 
-      0,   0,   0,   0,  45, 186, 
-     46, 241,   1,   0,   0,   0, 
-      0,   0,   0,   0, 120,  10, 
-      0,   0,  32,   0,   0,  96, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      2,   0,   2,   0,   7,   0, 
-      0,   0,   0,   0,   1,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0, 120,  10,   0,   0, 
-      8,   2,   0,   0,   0,   0, 
-      0,   0, 255, 255, 255, 255, 
-      0,   0,   0,   0, 255, 255, 
-    255, 255,   1,   0,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,  67,  58,  92,  85, 
-    115, 101, 114, 115,  92, 107, 
-    111, 108, 106,  97,  92,  68, 
-    101, 115, 107, 116, 111, 112, 
-     92,  75, 111, 108, 106,  97, 
-     45,  83, 116, 114, 111, 104, 
-    109,  45,  71,  97, 109, 101, 
-    115,  92,  83, 112, 105, 101, 
-    108, 101,  32,  80, 108,  97, 
-    116, 102, 111, 114, 109,  92, 
-     83, 116,  97, 110, 100,  97, 
-    108, 111, 119, 110,  92,  75, 
-    108, 105, 101, 110, 116,  92, 
-     70,  97,  99, 116, 111, 114, 
-    121,  67, 114,  97, 102, 116, 
-     92,  70,  97,  99, 116, 111, 
-    114, 121,  67, 114,  97, 102, 
-    116,  92,  68,  88,  49,  49, 
-     67, 117, 115, 116, 111, 109, 
-     86, 101, 114, 116, 101, 120, 
-     83, 104,  97, 100, 101, 114, 
-     46, 104, 108, 115, 108,   0, 
-      0,   0, 254, 239, 254, 239, 
-      1,   0,   0,   0,   1,   0, 
-      0,   0,   0,   1,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0, 255, 255, 255, 
-    255, 255, 255, 255, 255, 255, 
-    255,  12,   0, 255, 255, 255, 
-    255, 255, 255, 255, 255, 255, 
-    255,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -3985,51 +3968,6 @@ const BYTE CustomUIDX11VertexShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    148,  46,  49,   1,  99,  87, 
-     18,  99,   1,   0,   0,   0, 
-    102, 225,  45, 108,  95,  87, 
-    214,  75, 171,  78,  55, 217, 
-    174, 146, 233, 109, 175,   0, 
-      0,   0,  47,  76, 105, 110, 
-    107,  73, 110, 102, 111,   0, 
-     47, 110,  97, 109, 101, 115, 
-      0,  47, 115, 114,  99,  47, 
-    104, 101,  97, 100, 101, 114, 
-     98, 108, 111,  99, 107,   0, 
-     47, 115, 114,  99,  47, 102, 
-    105, 108, 101, 115,  47,  99, 
-     58,  92, 117, 115, 101, 114, 
-    115,  92, 107, 111, 108, 106, 
-     97,  92, 100, 101, 115, 107, 
-    116, 111, 112,  92, 107, 111, 
-    108, 106,  97,  45, 115, 116, 
-    114, 111, 104, 109,  45, 103, 
-     97, 109, 101, 115,  92, 115, 
-    112, 105, 101, 108, 101,  32, 
-    112, 108,  97, 116, 102, 111, 
-    114, 109,  92, 115, 116,  97, 
-    110, 100,  97, 108, 111, 119, 
-    110,  92, 107, 108, 105, 101, 
-    110, 116,  92, 102,  97,  99, 
-    116, 111, 114, 121,  99, 114, 
-     97, 102, 116,  92, 102,  97, 
-     99, 116, 111, 114, 121,  99, 
-    114,  97, 102, 116,  92, 100, 
-    120,  49,  49,  99, 117, 115, 
-    116, 111, 109, 118, 101, 114, 
-    116, 101, 120, 115, 104,  97, 
-    100, 101, 114,  46, 104, 108, 
-    115, 108,   0,   4,   0,   0, 
-      0,   6,   0,   0,   0,   1, 
-      0,   0,   0,  30,   0,   0, 
-      0,   0,   0,   0,   0,  17, 
-      0,   0,   0,   7,   0,   0, 
-      0,  34,   0,   0,   0,   8, 
-      0,   0,   0,  10,   0,   0, 
-      0,   6,   0,   0,   0,   0, 
-      0,   0,   0,   5,   0,   0, 
-      0,   0,   0,   0,   0, 220, 
-     81,  51,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -4047,15 +3985,77 @@ const BYTE CustomUIDX11VertexShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+    255, 255, 255, 255, 119,   9, 
+     49,   1,   1,   0,   0,   0, 
+     13,   0,   0, 142,  14,   0, 
+     63,  92,  15,   0,   0,   0, 
+     92,   0,   0,   0,  32,   0, 
+      0,   0,  44,   0,   0,   0, 
+    144,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+     22,   0,   0,   0,  25,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   1,   0,   0,   0, 
+      0,   0,   0,   0, 120,  10, 
+      0,   0,  32,   0,   0,  96, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      2,   0,   9,   0,  64,   6, 
       0,   0,   0,   0,   0,   0, 
+    236,   8,   0,   0,   1,   0, 
+    250, 238,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,  84, 101, 120, 116, 
+    117, 114, 101,  86, 101, 114, 
+    116, 101, 120,  83, 104,  97, 
+    100, 101, 114,   0, 110, 111, 
+    110, 101,   0,   0,   0,   0, 
+     45, 186,  46, 241,   1,   0, 
       0,   0,   0,   0,   0,   0, 
+    120,  10,   0,   0,  32,   0, 
+      0,  96,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
+      0,   0,   2,   0,   2,   0, 
+      7,   0,   0,   0,   0,   0, 
+      1,   0, 255, 255, 255, 255, 
+      0,   0,   0,   0, 120,  10, 
+      0,   0,   8,   2,   0,   0, 
+      0,   0,   0,   0, 255, 255, 
+    255, 255,   0,   0,   0,   0, 
+    255, 255, 255, 255,   1,   0, 
+      1,   0,   0,   0,   1,   0, 
+      0,   0,   0,   0,  67,  58, 
+     92,  85, 115, 101, 114, 115, 
+     92, 107, 111, 108, 106,  97, 
+     92,  68, 101, 115, 107, 116, 
+    111, 112,  92,  75, 111, 108, 
+    106,  97,  45,  83, 116, 114, 
+    111, 104, 109,  45,  71,  97, 
+    109, 101, 115,  92,  83, 112, 
+    105, 101, 108, 101,  32,  80, 
+    108,  97, 116, 102, 111, 114, 
+    109,  92,  83, 116,  97, 110, 
+    100,  97, 108, 111, 119, 110, 
+     92,  75, 108, 105, 101, 110, 
+    116,  92,  70,  97,  99, 116, 
+    111, 114, 121,  67, 114,  97, 
+    102, 116,  92,  70,  97,  99, 
+    116, 111, 114, 121,  67, 114, 
+     97, 102, 116,  92,  68,  88, 
+     49,  49,  67, 117, 115, 116, 
+    111, 109,  86, 101, 114, 116, 
+    101, 120,  83, 104,  97, 100, 
+    101, 114,  46, 104, 108, 115, 
+    108,   0,   0,   0, 254, 239, 
+    254, 239,   1,   0,   0,   0, 
+      1,   0,   0,   0,   0,   1, 
+      0,   0,   0,   0,   0,   0, 
+      0,   0,   0,   0,   0, 255, 
+    255, 255, 255, 255, 255, 255, 
+    255, 255, 255,  12,   0, 255, 
+    255, 255, 255, 255, 255, 255, 
+    255, 255, 255,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -4082,9 +4082,9 @@ const BYTE CustomUIDX11VertexShader[] =
      40,   0,   0,   0,  92,   2, 
       0,   0,  44,   0,   0,   0, 
     192,   0,   0,   0,   3,   0, 
-      0,   0,  36,   0,   0,   0, 
-     24,   0,   0,   0,  23,   0, 
       0,   0,  35,   0,   0,   0, 
+     24,   0,   0,   0,  23,   0, 
+      0,   0,  36,   0,   0,   0, 
      25,   0,   0,   0,  13,   0, 
       0,   0,   6,   0,   0,   0, 
      26,   0,   0,   0,  27,   0, 

+ 7 - 2
FactoryCraft/FactoryClient.cpp

@@ -45,10 +45,15 @@ void FactoryClient::loadServerInfo()
         foregroundReader->lese((char*)&id, 4);
         bool needsInstance;
         foregroundReader->lese((char*)&needsInstance, 1);
+        bool needsSubscription;
+        foregroundReader->lese((char*)&needsSubscription, 1);
         int maxHp;
         foregroundReader->lese((char*)&maxHp, 4);
-        blockTypes[i] = new BlockType(
-            id, needsInstance, ModelInfo(foregroundReader), maxHp);
+        blockTypes[i] = new BlockType(id,
+            needsInstance,
+            ModelInfo(foregroundReader),
+            maxHp,
+            needsSubscription);
     }
     foregroundReader->lese((char*)&itemTypeCount, 4);
     itemTypes = new ItemType*[itemTypeCount];

+ 173 - 0
FactoryCraft/Load.cpp

@@ -587,12 +587,185 @@ void createGrass(Bildschirm* zScreen)
     data->release();
 }
 
+void createFluidCube(Bildschirm* zScreen)
+{
+    Model3DData* data = zScreen->zGraphicsApi()->createModel("fluid");
+    data->setAmbientFactor(0.f);
+    data->setDiffusFactor(1.f);
+    data->setSpecularFactor(0.f);
+    float size = 1;
+    float left, right, top, bottom;
+    // Calculate the screen coordinates of the left side of the bitmap.
+    right = (float)((-size / 2.0));
+    // Calculate the screen coordinates of the right side of the bitmap.
+    left = right + (float)size;
+    // Calculate the screen coordinates of the top of the bitmap.
+    top = (float)(size / 2.0);
+    // Calculate the screen coordinates of the bottom of the bitmap.
+    bottom = top - (float)size;
+    float front = -size / 2;
+    float back = front + size;
+
+    Vertex3D* vertecies = new Vertex3D[24];
+    for (int i = 0; i < 24; i++)
+        vertecies[i].knochenId = 0;
+    // front side
+    vertecies[0].pos = Vec3<float>(left, front, top);
+    vertecies[0].tPos = Vec2<float>(0.f, 0.f);
+    vertecies[0].knochenId = 1;
+    vertecies[1].pos = Vec3<float>(right, front, top);
+    vertecies[1].tPos = Vec2<float>(1.f, 0.f);
+    vertecies[1].knochenId = 2;
+    vertecies[2].pos = Vec3<float>(left, front, bottom);
+    vertecies[2].tPos = Vec2<float>(0.f, 1.f);
+    vertecies[3].pos = Vec3<float>(right, front, bottom);
+    vertecies[3].tPos = Vec2<float>(1.f, 1.f);
+    // back side
+    vertecies[4].pos = Vec3<float>(right, back, top);
+    vertecies[4].tPos = Vec2<float>(0.0f, 0.0f);
+    vertecies[4].knochenId = 3;
+    vertecies[5].pos = Vec3<float>(left, back, top);
+    vertecies[5].tPos = Vec2<float>(1.0f, 0.0f);
+    vertecies[5].knochenId = 4;
+    vertecies[6].pos = Vec3<float>(right, back, bottom);
+    vertecies[6].tPos = Vec2<float>(0.0f, 1.0f);
+    vertecies[7].pos = Vec3<float>(left, back, bottom);
+    vertecies[7].tPos = Vec2<float>(1.0f, 1.0f);
+    // left side
+    vertecies[8].pos = Vec3<float>(left, back, top);
+    vertecies[8].tPos = Vec2<float>(0.f, 0.f);
+    vertecies[8].knochenId = 4;
+    vertecies[9].pos = Vec3<float>(left, front, top);
+    vertecies[9].tPos = Vec2<float>(1.f, 0.f);
+    vertecies[9].knochenId = 1;
+    vertecies[10].pos = Vec3<float>(left, back, bottom);
+    vertecies[10].tPos = Vec2<float>(0.f, 1.f);
+    vertecies[11].pos = Vec3<float>(left, front, bottom);
+    vertecies[11].tPos = Vec2<float>(1.f, 1.f);
+    // right side
+    vertecies[12].pos = Vec3<float>(right, front, top);
+    vertecies[12].tPos = Vec2<float>(0.0f, 0.0f);
+    vertecies[12].knochenId = 2;
+    vertecies[13].pos = Vec3<float>(right, back, top);
+    vertecies[13].tPos = Vec2<float>(1.0f, 0.0f);
+    vertecies[13].knochenId = 3;
+    vertecies[14].pos = Vec3<float>(right, front, bottom);
+    vertecies[14].tPos = Vec2<float>(0.0f, 1.0f);
+    vertecies[15].pos = Vec3<float>(right, back, bottom);
+    vertecies[15].tPos = Vec2<float>(1.0f, 1.0f);
+    // top side
+    vertecies[16].pos = Vec3<float>(left, back, top);
+    vertecies[16].tPos = Vec2<float>(0.f, 0.f);
+    vertecies[16].knochenId = 4;
+    vertecies[17].pos = Vec3<float>(right, back, top);
+    vertecies[17].knochenId = 3;
+    vertecies[17].tPos = Vec2<float>(1.f, 0.f);
+    vertecies[18].pos = Vec3<float>(left, front, top);
+    vertecies[18].tPos = Vec2<float>(0.f, 1.f);
+    vertecies[18].knochenId = 1;
+    vertecies[19].pos = Vec3<float>(right, front, top);
+    vertecies[19].tPos = Vec2<float>(1.f, 1.f);
+    vertecies[19].knochenId = 2;
+    // botom side
+    vertecies[20].pos = Vec3<float>(left, front, bottom);
+    vertecies[20].tPos = Vec2<float>(0.0f, 0.0f);
+    vertecies[21].pos = Vec3<float>(right, front, bottom);
+    vertecies[21].tPos = Vec2<float>(1.0f, 0.0f);
+    vertecies[22].pos = Vec3<float>(left, back, bottom);
+    vertecies[22].tPos = Vec2<float>(0.0f, 1.0f);
+    vertecies[23].pos = Vec3<float>(right, back, bottom);
+    vertecies[23].tPos = Vec2<float>(1.0f, 1.0f);
+
+    data->setVertecies(vertecies, 24);
+    // the order of the polygons has to be NORTH (front), EAST (left), SOUTH
+    // (back), WEST (right), TOP, BOTTOM according to the Area definition front
+    // side
+    Polygon3D* p
+        = new Polygon3D(); // looking from (0,0,0) to (1,0,0) to see this side
+    p->indexAnz = 6;
+    p->indexList = new int[p->indexAnz];
+    p->indexList[0] = 0;
+    p->indexList[1] = 1;
+    p->indexList[2] = 2;
+    p->indexList[3] = 1;
+    p->indexList[4] = 3;
+    p->indexList[5] = 2;
+    data->addPolygon(p);
+    // left side
+    p = new Polygon3D(); // looking from (0,0,0) to (0,1,0) to see this side
+    p->indexAnz = 6;
+    p->indexList = new int[p->indexAnz];
+    p->indexList[0] = 0 + 8;
+    p->indexList[1] = 1 + 8;
+    p->indexList[2] = 2 + 8;
+    p->indexList[3] = 1 + 8;
+    p->indexList[4] = 3 + 8;
+    p->indexList[5] = 2 + 8;
+    data->addPolygon(p);
+    // back side
+    p = new Polygon3D(); // looking from (0,0,0) to (-1,0,0) to see this side
+    p->indexAnz = 6;
+    p->indexList = new int[p->indexAnz];
+    p->indexList[0] = 0 + 4;
+    p->indexList[1] = 1 + 4;
+    p->indexList[2] = 2 + 4;
+    p->indexList[3] = 1 + 4;
+    p->indexList[4] = 3 + 4;
+    p->indexList[5] = 2 + 4;
+    data->addPolygon(p);
+    // right side
+    p = new Polygon3D(); // looking from (0,0,0) to (0,-1,0) to see this side
+    p->indexAnz = 6;
+    p->indexList = new int[p->indexAnz];
+    p->indexList[0] = 0 + 12;
+    p->indexList[1] = 1 + 12;
+    p->indexList[2] = 2 + 12;
+    p->indexList[3] = 1 + 12;
+    p->indexList[4] = 3 + 12;
+    p->indexList[5] = 2 + 12;
+    data->addPolygon(p);
+    // top side
+    p = new Polygon3D(); // looking from (0,0,0) to (0,0,-1) to see this side
+    p->indexAnz = 6;
+    p->indexList = new int[p->indexAnz];
+    p->indexList[0] = 0 + 16;
+    p->indexList[1] = 1 + 16;
+    p->indexList[2] = 2 + 16;
+    p->indexList[3] = 1 + 16;
+    p->indexList[4] = 3 + 16;
+    p->indexList[5] = 2 + 16;
+    data->addPolygon(p);
+    // botom side
+    p = new Polygon3D(); // looking from (0,0,0) to (0,0,1) to see this side
+    p->indexAnz = 6;
+    p->indexList = new int[p->indexAnz];
+    p->indexList[0] = 0 + 20;
+    p->indexList[1] = 1 + 20;
+    p->indexList[2] = 2 + 20;
+    p->indexList[3] = 1 + 20;
+    p->indexList[4] = 3 + 20;
+    p->indexList[5] = 2 + 20;
+    data->addPolygon(p);
+
+    Skelett* s = new Skelett();
+    s->addKnochen(new Knochen(0));
+    s->addKnochen(new Knochen(1), 0);
+    s->addKnochen(new Knochen(2), 0);
+    s->addKnochen(new Knochen(3), 0);
+    s->addKnochen(new Knochen(4), 0);
+    data->setSkelettZ(s);
+
+    data->calculateNormals();
+    data->release();
+}
+
 void createModels(Bildschirm* zScreen)
 {
     createDefaultCube(zScreen);
     createCubeItem(zScreen);
     createPlayer(zScreen);
     createGrass(zScreen);
+    createFluidCube(zScreen);
 }
 
 LoadMenu::LoadMenu(Bildschirm* zScreen)

+ 114 - 0
FactoryCraft/Main.cpp

@@ -9,10 +9,124 @@
 #include <Network.h>
 #include <RenderThread.h>
 #include <Schrift.h>
+#include <Textur.h>
 
 #include "CustomDX11API.h"
 #include "Globals.h"
 
+void createModels(Bildschirm* zScreen);
+
+/* Test rendering of specific block types
+int KSGStart Framework::Start(Framework::Startparam p)
+{
+    Network::Start(20);
+    initVariables();
+    setDebugDX(1);
+
+    Datei d;
+    d.setDatei("data/schriften");
+    auto list = d.getDateiListe();
+    for (Text* fontFile : *list)
+    {
+        LTDSDatei dat;
+        dat.setPfad(
+            new Text(Text("data/schriften/").operator+(fontFile->getText())));
+        dat.leseDaten();
+        Text* name = fontFile->getTeilText(0, fontFile->getLength() - 5);
+        fontRegister->put(*name, RCPointer<Schrift>::of(dat.ladeSchrift()));
+        name->release();
+    }
+    list->release();
+
+    WFenster window;
+    ::window = &window;
+    WNDCLASS wc = Framework::F_Normal(p.hinst);
+    wc.lpszClassName = "Factory Craft";
+    window.erstellen(WS_POPUPWINDOW, wc);
+    Monitor m = Framework::getMonitor(0);
+    window.setBounds(Punkt(m.x, m.y), Punkt(m.breite, m.height));
+    window.setAnzeigeModus(SW_SHOWNORMAL);
+    window.setVSchließAktion([&window](void* p, void* f) {
+        StopNachrichtenSchleife(window.getFensterHandle());
+    });
+    window.setMausAktion(_ret1ME);
+    window.setTastaturAktion(_ret1TE);
+    Bildschirm3D screen(
+        dynamic_cast<WFenster*>(window.getThis()), new CustomDX11API());
+    screen.setHandleUserInputsOnTick(1);
+    window.setBildschirm(dynamic_cast<Bildschirm*>(screen.getThis()));
+    screen.setFillFarbe(0);
+
+    uiFactory = Framework::defaultUI(fontRegister->get("normal"), &screen);
+
+    createModels(&screen);
+
+    // loading textures
+    Datei texturF;
+    texturF.setDatei("data/textures");
+    RCArray<Text>* files = texturF.getDateiListe();
+    if (files)
+    {
+        int count = 0;
+        for (Text* fileName : *files)
+        {
+            LTDBDatei dat;
+            dat.setDatei(new Text(Text("data/textures/") + *fileName));
+            dat.leseDaten(0);
+            count += dat.getBildAnzahl();
+        }
+        for (Text* fileName : *files)
+        {
+            LTDBDatei dat;
+            dat.setDatei(new Text(Text("data/textures/") + *fileName));
+            dat.leseDaten(0);
+            for (Text* name : *dat.zBildListe())
+            {
+                Bild* b = dat.laden(0, new Text(*name));
+                screen.zGraphicsApi()
+                    ->createOrGetTextur(*fileName + "/" + *name, b)
+                    ->release();
+            }
+        }
+        files->release();
+    }
+
+    BlockType* type = new BlockType(
+        26, 1, ModelInfo("cube", "fluids.ltdb/water.png", 0, 6), 10, 1); // block type to render
+    Block* b = type->createBlock(Vec3<float>(0, 0, 0));
+    unsigned char light[] = {255, 255, 255, 255, 255, 255};
+    b->setLightData(TOP, light);
+    b->setLightData(NORTH, light);
+    b->setLightData(EAST, light);
+    b->setLightData(SOUTH, light);
+    b->setLightData(WEST, light);
+    b->setLightData(BOTTOM, light);
+    Chunk *c = new Chunk(Punkt(0, 0));
+    c->setBlock(b);
+    Welt3D* w = new Welt3D();
+    w->addCollection(c);
+    Kam3D* kam = new Kam3D();
+    kam->setStyle(
+        Kam3D::Style::Movable | Kam3D::Style::Rotatable | Kam3D::Style::Tick);
+    kam->setPosition(Vec3<float>(10, 0, 0));
+    kam->setAusrichtung(Vec3<float>(0, 0, 0));
+    kam->setWelt(w);
+    screen.addKamera(kam);
+
+    RenderTh rTh;
+    rTh.setMaxFps(60);
+    rTh.setQuiet(1);
+    rTh.setBildschirm(dynamic_cast<Bildschirm*>(screen.getThis()));
+
+    rTh.beginn();
+    StartNachrichtenSchleife();
+    rTh.beenden();
+    releaseVariables();
+    Network::Exit();
+    return 0;
+}
+*/
+
 int KSGStart Framework::Start(Framework::Startparam p)
 {
     Network::Start(20);

+ 8 - 0
FactoryCraft/ModelInfo.cpp

@@ -6,6 +6,14 @@
 
 using namespace Framework;
 
+ModelInfo::ModelInfo(const char* model, const char *texture, bool transparent, int numTextures)
+    : modelPath(model),
+      transparent(transparent)
+{
+    for (int i = 0; i < numTextures; i++)
+        texturPaths.add(new Text(texture));
+}
+
 ModelInfo::ModelInfo(Framework::StreamReader* reader)
 {
     char len;

+ 4 - 0
FactoryCraft/ModelInfo.h

@@ -13,6 +13,10 @@ private:
     bool transparent;
 
 public:
+    ModelInfo(const char* model,
+        const char *texture,
+        bool transparent,
+        int numTextures);
     ModelInfo(Framework::StreamReader* reader);
 
     Framework::Model3DData* getModel() const;