Bladeren bron

add uiml tooltips describing the currently targeted block

Kolja Strohm 2 jaren geleden
bovenliggende
commit
f0bd5be645
61 gewijzigde bestanden met toevoegingen van 607 en 5125 verwijderingen
  1. 25 0
      FactoryCraft/Game.cpp
  2. 2 0
      FactoryCraft/Game.h
  3. 12 0
      FactoryCraft/World.cpp
  4. 0 30
      enc_temp_folder/107b1a479d1edc90e5af3d148a259357/Equipment.h
  5. 0 19
      enc_temp_folder/1143b7508c7358196f99bc3caaa0fd/ModelInfo.h
  6. 364 0
      enc_temp_folder/1a817e8f36ffebee508049966bba3a7f/World.cpp
  7. 0 44
      enc_temp_folder/1e8437822bd13cd1a5e19507ca641b0/Block.h
  8. 0 396
      enc_temp_folder/21617dc069ecd3eaef31d6ce92fc56e5/InventoryView.cpp
  9. 0 466
      enc_temp_folder/2259c96ab2a3916f359853f36282337/Entity.cpp
  10. 0 14
      enc_temp_folder/2732994fb4435f576fdce2c1194fde8/AddEntityUpdate.h
  11. 0 31
      enc_temp_folder/29ba8b78dd7e83ca667f1499ba935536/Initialisierung.h
  12. 0 44
      enc_temp_folder/2e3f6cd4bfac3bffdfa7e916c1b6a19/EntityType.cpp
  13. 0 19
      enc_temp_folder/2fdfb0b658ed7fdeeb462a6c24ece4/AddServerMenu.h
  14. 0 37
      enc_temp_folder/3112d9feb6108e97e3d1601255838b8e/ItemBar.h
  15. 0 16
      enc_temp_folder/316083384fb252cde515408067a06dd5/Load.h
  16. 0 252
      enc_temp_folder/316650b8b86a35dbcc28e142c50b2ba/Dimension.cpp
  17. 0 68
      enc_temp_folder/33937a68c5128732d77739a9e125756/StaticRegistry.h
  18. 0 553
      enc_temp_folder/3a55cd8d8af5f8ea2a64d516d5bc5692/Load.cpp
  19. 0 32
      enc_temp_folder/3c2afc6a4b27a7caad432882b3711f1c/BlockType.cpp
  20. 0 11
      enc_temp_folder/417d9d558f3e8f5f14c5cf33fb5986a/DragElement.h
  21. 0 45
      enc_temp_folder/451246f3f099a7e663dcea31b22f288/ModelInfo.cpp
  22. 0 18
      enc_temp_folder/45ba55b34681a81f4c8590e163c81db8/CustomDX11API.h
  23. 0 21
      enc_temp_folder/4876b17b4f30766328b89d442a16e79/EntityType.h
  24. 0 22
      enc_temp_folder/4cf3c1a3eadd27e1b61e410a2f7b5b3/Menu.cpp
  25. 0 18
      enc_temp_folder/4d1a72a6f5157678fdc872365e12c1b/AddEntityUpdate.cpp
  26. 0 165
      enc_temp_folder/51501657c4a6cf4d357c29932b1dd6a/Initialisierung.cpp
  27. 0 277
      enc_temp_folder/52dda8697ab91ee9d2c9ac2061cdff7/Chunk.cpp
  28. 0 27
      enc_temp_folder/5795ce2e2f68bd624f1cc69f0f5c8da/BlockType.h
  29. 0 16
      enc_temp_folder/6bb73f40c164ba9b456ed65bee126b99/StaticInitializerOrder.cpp
  30. 0 62
      enc_temp_folder/6c14995eccfa6537b21468f668959267/DragController.h
  31. 0 14
      enc_temp_folder/72156073275f6358c87cd3cf596fcc4/EntityRemovedUpdate.cpp
  32. 0 46
      enc_temp_folder/731a4feda1e46a1d2df75b3f2592ee7/FactoryClient.h
  33. 0 31
      enc_temp_folder/7a1b7c013656d33b6d1375faeb4bd9/Game.h
  34. 0 338
      enc_temp_folder/8274a4e22fc21f2821b38041b42242/World.cpp
  35. 0 67
      enc_temp_folder/8726edde9d5ce1ea4fea362660bb528e/Main.cpp
  36. 0 154
      enc_temp_folder/89933bbcaa9a07595a67688884dbd2/PlayerKam.cpp
  37. 0 26
      enc_temp_folder/934b78f6f6df2e34ddbc8435a7aae/UIMLToolTip.cpp
  38. 0 33
      enc_temp_folder/973c14c36971b73cfeec68881d0683/Area.h
  39. 204 0
      enc_temp_folder/9b638151c6d234a85fa47499df0b4ba/Game.cpp
  40. 0 37
      enc_temp_folder/9fe4615ad7bd97e9947e71f0c09e7f2d/Chunk.h
  41. 0 115
      enc_temp_folder/a0fa8bd84ace35bac3eb2735544cd/AddServerMenu.cpp
  42. 0 209
      enc_temp_folder/a36e7559d0941b36cff6d7348813d2d2/Block.cpp
  43. 0 63
      enc_temp_folder/a64d52bdd16464cbf99c34b69d888f2/InventoryView.h
  44. 0 23
      enc_temp_folder/a860cdbf2c962163648b92d4fae0758f/PlayerKam.h
  45. 0 79
      enc_temp_folder/aedf935c6dd4db16dd4e3a49daa122/Area.cpp
  46. 0 53
      enc_temp_folder/b37db95da51546ad7e8cc1c82cf42/Equipment.cpp
  47. 0 14
      enc_temp_folder/b84b4e808b53ee53a977af8adca3bed/EntityRemovedUpdate.h
  48. 0 174
      enc_temp_folder/ba411bc21d64e1d04caa78589c762/Game.cpp
  49. 0 6
      enc_temp_folder/c5f2270d6bed8d7cbc360ea8541de2b/Constants.h
  50. 0 39
      enc_temp_folder/c8104cfdb4649a34402666be87bd5661/Dimension.h
  51. 0 35
      enc_temp_folder/c9cbefe684b7ad84345e9ec04d905b/CustomDX11API.cpp
  52. 0 19
      enc_temp_folder/d2cfdfdd6c2c64205fc6875e214b27b/Menu.h
  53. 0 19
      enc_temp_folder/d46158fac4ce94c9b95a6c8415891c65/WorldUpdate.h
  54. 0 20
      enc_temp_folder/d4e616c36a8b1e2a2abad0acef14d75e/Dialog.h
  55. 0 49
      enc_temp_folder/d96dc9ecf990a09e6658711cb19a4160/CraftingGrid.h
  56. 0 18
      enc_temp_folder/daab62b53a5e77ff5b74c75dfd9d368/Registries.h
  57. 0 26
      enc_temp_folder/db15399a5a58f3136329d834c5e88aa/WorldUpdate.cpp
  58. 0 447
      enc_temp_folder/eadbdf47d7cfcc5ecf485550d574c/CraftingGrid.cpp
  59. 0 56
      enc_temp_folder/eb39f2494bc1df93bab2e22e54d5/World.h
  60. 0 47
      enc_temp_folder/ef2be821964b97a79f24226c6ce03c60/Entity.h
  61. 0 165
      enc_temp_folder/f68e3c78e417e9bed1beacfd7bb406b/ItemBar.cpp

+ 25 - 0
FactoryCraft/Game.cpp

@@ -45,6 +45,11 @@ Game::Game(Bildschirm* zScreen)
     guiView->setStyle(UIMLView::Style::Sichtbar);
     guiView->setSize(window->zBildschirm()->getBackBufferSize());
     elements.add(guiView);
+    targetUIMLView = new UIMLView("<v/>", uiFactory);
+    targetUIMLView->setStyle(UIMLView::Style::Hintergrund
+                             | UIMLView::Style::HAlpha);
+    targetUIMLView->setHintergrundFarbe(0xA0000000);
+    elements.add(targetUIMLView);
 }
 
 Game::~Game()
@@ -178,4 +183,24 @@ void Game::closeCurrentDialog()
 DragController<InventoryDragSource, int>* Game::zInventoryDragController()
 {
     return inventoryDragController;
+}
+
+void Game::setTargetUIML(Framework::Text uiml)
+{
+    if (uiml.getLength())
+    {
+        window->zBildschirm()->lock();
+        targetUIMLView->setUIML(uiml);
+        targetUIMLView->layout();
+        window->zBildschirm()->unlock();
+        targetUIMLView->setSize(targetUIMLView->calculateContentSize());
+        targetUIMLView->setPosition(
+            window->zBildschirm()->zGraphicsApi()->getBackBufferSize()
+            - targetUIMLView->getSize());
+        targetUIMLView->addStyle(UIMLView::Style::Sichtbar);
+    }
+    else
+    {
+        targetUIMLView->removeStyle(UIMLView::Style::Sichtbar);
+    }
 }

+ 2 - 0
FactoryCraft/Game.h

@@ -17,6 +17,7 @@ private:
     Framework::TextFeld* debug;
     Framework::Array<UIMLDialog*> dialogs;
     Framework::UIMLView* guiView;
+    Framework::UIMLView* targetUIMLView;
     DragController<InventoryDragSource, int>* inventoryDragController;
 
 public:
@@ -28,4 +29,5 @@ public:
     void api(char* data);
     void closeCurrentDialog();
     DragController<InventoryDragSource, int>* zInventoryDragController();
+    void setTargetUIML(Framework::Text uiml);
 };

+ 12 - 0
FactoryCraft/World.cpp

@@ -82,14 +82,26 @@ void World::update(bool background)
                     {
                     case 0:
                         setTarget(0);
+                        ((Game*)(Menu*)menuRegister->get("game"))
+                            ->setTargetUIML("");
                         break;
                     case 1:
                         setTarget(zEntity(*(int*)(data + 2)));
+                        ((Game*)(Menu*)menuRegister->get("game"))
+                            ->setTargetUIML("");
                         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;
                     }
                     break;

+ 0 - 30
enc_temp_folder/107b1a479d1edc90e5af3d148a259357/Equipment.h

@@ -1,30 +0,0 @@
-#pragma once
-
-#include "NetworkAPIProcessor.h"
-
-#include <UIMLView.h>
-
-class EquipmentElement : public Framework::UIMLElement
-{
-public:
-	EquipmentElement();
-	//! prüft, ob dieses UIML Element für ein bestimmtes xml Element zuständig ist
-	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;
-	//! wendet die layout parameter zu einer Zeichnung an
-	void layout(Framework::XML::Element& element, Framework::Zeichnung& z, int pWidth, int pHeight, Framework::UIMLContainer& generalLayouter) override;
-};
-
-class EquipmentView : public Framework::ZeichnungHintergrund, public NetworkAPIProcessor
-{
-private:
-	int entityId;
-
-public:
-	EquipmentView(int entityId);
-	void api(char* message) override;
-	bool tick(double tickVal) override;
-	void render(Framework::Bild& rObj) override;
-	void doMausEreignis(Framework::MausEreignis& me, bool userRet) override;
-};

+ 0 - 19
enc_temp_folder/1143b7508c7358196f99bc3caaa0fd/ModelInfo.h

@@ -1,19 +0,0 @@
-#pragma once
-
-#include <Text.h>
-#include <Array.h>
-#include <Reader.h>
-#include <Model3D.h>
-
-class ModelInfo
-{
-private:
-	Framework::Text modelPath;
-	Framework::RCArray<Framework::Text> texturPaths;
-
-public:
-	ModelInfo(Framework::StreamReader* reader);
-
-	Framework::Model3DData* getModel() const;
-	Framework::Model3DTextur* getTexture() const;
-};

+ 364 - 0
enc_temp_folder/1a817e8f36ffebee508049966bba3a7f/World.cpp

@@ -0,0 +1,364 @@
+#include "World.h"
+
+#include <AsynchronCall.h>
+#include <GraphicsApi.h>
+#include <iostream>
+#include <Network.h>
+#include <Welt3D.h>
+
+#include "Constants.h"
+#include "Game.h"
+#include "Globals.h"
+#include "Registries.h"
+#include "WorldUpdate.h"
+
+using namespace Network;
+using namespace Framework;
+
+World* World::INSTANCE = 0;
+
+World::World(Bildschirm3D* zScreen, FactoryClient* client)
+    : Thread(),
+      client(client)
+{
+    renderedWorld = new Welt3D();
+    renderedWorld->addDiffuseLight(DiffuseLight{
+        Vec3<float>(0.5f, 0.5f, -1.f), Vec3<float>(1.f, 1.f, 1.f)});
+    currentDimension = new Dimension();
+    zScreenPtr = zScreen;
+    kam = new PlayerKam(zScreen);
+    kam->setWelt(renderedWorld);
+    zScreen->addKamera(kam);
+    firstMessage = 1;
+    ownEntityId = -1;
+    currentTarget = 0;
+    start();
+}
+
+World::~World()
+{
+    zScreenPtr->removeKamera(kam);
+    currentDimension->release();
+    if (currentTarget) currentTarget->release();
+    client->release();
+}
+
+void World::update(bool background)
+{
+    NetworkReader* serverMessageReader = 0;
+    unsigned char type = 0;
+    while (background
+               ? serverMessageReader = client->getNextBackgroundMessage()
+               : 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;
+            serverMessageReader->lese((char*)&length, 4);
+            char* data = new char[length];
+            serverMessageReader->lese(data, length);
+            switch (data[0])
+            {
+            case 1: // dimension message
+                {
+                    currentDimension->api(data + 1);
+                    break;
+                }
+            case 2: // gui message
+                ((Game*)(Menu*)menuRegister->get("game"))->api(data + 1);
+                break;
+            case 3: // set target
+                {
+                    switch (data[1])
+                    {
+                    case 0:
+                        setTarget(0);
+                        break;
+                    case 1:
+                        setTarget(zEntity(*(int*)(data + 2)));
+                        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;
+                    }
+                    break;
+                }
+            }
+            delete[] data;
+            // TODO: process messages
+        }
+        if (type == 4) // POSITION UPDATE
+        {
+            int old = ownEntityId;
+            serverMessageReader->lese((char*)&ownEntityId, 4);
+            kam->setEntityId(ownEntityId);
+            Entity* p = zEntity(ownEntityId);
+            if (p) p->setPlayerControlled();
+            if (old != ownEntityId) client->sendPlayerAction("\5", 1);
+        }
+        client->endMessageReading(background);
+    }
+    client->endMessageReading(background);
+    Entity* player = getCurrentPlayerEntity();
+    if (player)
+    {
+        renderedWorld->lock();
+        currentDimension->removeDistantChunks(
+            {(int)player->getPos().x, (int)player->getPos().y});
+        Punkt currentChunk
+            = getChunkCenter((int)player->getX(), (int)player->getY());
+        for (int x = 0; x <= CHUNK_VISIBILITY_RANGE; x++)
+        {
+            for (int y = 0; y <= CHUNK_VISIBILITY_RANGE; y++)
+            {
+                std::function<void(Punkt)> requestChunk = [this](Punkt center) {
+                    Chunk* zC = currentDimension->zChunk(center);
+                    if (!zC)
+                    {
+                        char msg[1];
+                        msg[0] = 0; // add observer and request chaunk data
+                        Punkt pos = center;
+                        subLock.lock();
+                        bool found = 0;
+                        for (Punkt p : subscriptions)
+                        {
+                            if (p == pos)
+                            {
+                                found = 1;
+                                break;
+                            }
+                        }
+                        if (!found)
+                        {
+                            client->chunkAPIRequest(pos, msg, 1);
+                            subscriptions.add(pos);
+                        }
+                        subLock.unlock();
+                    }
+                };
+                requestChunk(
+                    currentChunk + Punkt(x * CHUNK_SIZE, y * CHUNK_SIZE));
+                if (y > 0)
+                    requestChunk(
+                        currentChunk + Punkt(x * CHUNK_SIZE, -y * CHUNK_SIZE));
+                if (x > 0)
+                {
+                    requestChunk(
+                        currentChunk + Punkt(-x * CHUNK_SIZE, y * CHUNK_SIZE));
+                    if (y > 0)
+                        requestChunk(currentChunk
+                                     + Punkt(-x * CHUNK_SIZE, -y * CHUNK_SIZE));
+                }
+            }
+        }
+        renderedWorld->unlock();
+    }
+}
+
+void World::setChunk(Chunk* chunk)
+{
+    zScreenPtr->lock();
+    renderedWorld->lock();
+    currentDimension->setChunk(chunk, chunk->getCenter());
+    renderedWorld->unlock();
+    zScreenPtr->unlock();
+}
+
+void World::thread()
+{
+    new AsynchronCall("World Update", [this]() {
+        while (true)
+        {
+            zScreenPtr->lock();
+            if (World::INSTANCE != this)
+            {
+                zScreenPtr->unlock();
+                return;
+            }
+            zScreenPtr->unlock();
+            update(0);
+            Sleep(10);
+        }
+    });
+    while (true)
+    {
+        zScreenPtr->lock();
+        if (World::INSTANCE != this)
+        {
+            zScreenPtr->unlock();
+            return;
+        }
+        zScreenPtr->unlock();
+        update(1);
+        Sleep(10);
+    }
+}
+
+Block* World::zBlockAt(Framework::Vec3<int> location) const
+{
+    return currentDimension->zBlock(location);
+    return 0;
+}
+
+Block* World::getBlockAt(Framework::Vec3<int> location) const
+{
+    return currentDimension->getBlock(location);
+    return 0;
+}
+
+Dimension* World::zDimension() const
+{
+    return currentDimension;
+}
+
+void World::setVisibility(Chunk* zChunk, bool visible)
+{
+    renderedWorld->lock();
+    if (visible)
+        renderedWorld->addCollection(
+            dynamic_cast<Framework::Model3DCollection*>(zChunk->getThis()));
+    else
+        renderedWorld->removeCollection(zChunk);
+    renderedWorld->unlock();
+}
+
+void World::setVisibility(Entity* zEntity, bool visible)
+{
+    renderedWorld->lock();
+    if (visible)
+        renderedWorld->addZeichnung(
+            dynamic_cast<Framework::Model3D*>(zEntity->getThis()));
+    else
+        renderedWorld->removeZeichnung(zEntity);
+    renderedWorld->unlock();
+}
+
+Framework::Punkt World::getChunkCenter(int x, int y) const
+{
+    return Punkt(((x < 0 ? x + 1 : x) / CHUNK_SIZE) * CHUNK_SIZE
+                     + (x < 0 ? -CHUNK_SIZE : CHUNK_SIZE) / 2,
+        ((y < 0 ? y + 1 : y) / CHUNK_SIZE) * CHUNK_SIZE
+            + (y < 0 ? -CHUNK_SIZE : CHUNK_SIZE) / 2);
+}
+
+Entity* World::zEntity(int id) const
+{
+    Entity* e = currentDimension->zEntity(id);
+    if (e) return e;
+    return 0;
+}
+
+Entity* World::getEntity(int id) const
+{
+    Entity* e = currentDimension->getEntity(id);
+    if (e) return e;
+    return 0;
+}
+
+void World::removeEntity(int id)
+{
+    currentDimension->removeEntity(id);
+}
+
+PlayerKam* World::zKamera() const
+{
+    return kam;
+}
+
+int World::getCurrentPlayerId() const
+{
+    return ownEntityId;
+}
+
+Entity* World::getCurrentPlayerEntity() const
+{
+    return zEntity(ownEntityId);
+}
+
+void World::setTarget(Framework::Model3D* zTarget)
+{
+    if (zTarget != currentTarget)
+    {
+        targetLock.lock();
+        if (currentTarget)
+        {
+            currentTarget->setAmbientFactor(
+                currentTarget->getAmbientFactor() - 0.2f);
+            currentTarget->release();
+            currentTarget = 0;
+        }
+        if (zTarget)
+        {
+            currentTarget
+                = dynamic_cast<Framework::Model3D*>(zTarget->getThis());
+            if (currentTarget)
+                currentTarget->setAmbientFactor(
+                    currentTarget->getAmbientFactor() + 0.2f);
+        }
+        targetLock.unlock();
+    }
+}
+
+void World::lockWorld()
+{
+    renderedWorld->lock();
+}
+
+void World::unlockWorld()
+{
+    renderedWorld->unlock();
+}
+
+void World::onChunkAdded(Punkt pos)
+{
+    subLock.lock();
+    int index = 0;
+    for (Punkt p : subscriptions)
+    {
+        if (p == pos)
+        {
+            subscriptions.remove(index);
+            break;
+        }
+        index++;
+    }
+    subLock.unlock();
+}
+
+Framework::Model3D* World::getCurrentTarget() const
+{
+    while (targetLock.isLocked())
+        Sleep(1);
+    return currentTarget
+             ? dynamic_cast<Framework::Model3D*>(currentTarget->getThis())
+             : 0;
+}
+
+Chunk* World::zChunk(Punkt center)
+{
+    return currentDimension->zChunk(center);
+}
+
+FactoryClient* World::zClient() const
+{
+    return client;
+}

+ 0 - 44
enc_temp_folder/1e8437822bd13cd1a5e19507ca641b0/Block.h

@@ -1,44 +0,0 @@
-#pragma once
-
-#include <Model3D.h>
-
-#include "BlockType.h"
-#include "Registries.h"
-#include "Area.h"
-
-using namespace Framework;
-
-class BasicBlockItemType;
-class Chunk;
-
-class Block : public Model3D
-{
-protected:
-	bool transparent;
-	float hp;
-	float maxHP;
-	const BlockType* zType;
-	bool sideVisible[6];
-	Vec3<int> location;
-	Framework::Textur* breakTextur;
-	unsigned char lightData[6 * 6];
-	char lightBuffer[24 * 4];
-
-	void beforeRender(GraphicsApi* api, Shader* zVertexShader, Shader* zPixelShader) override;
-	void afterRender(GraphicsApi* api, Shader* zVertexShader, Shader* zPixelShader) override;
-public:
-	Block(const BlockType* zType, Vec3<int> position, Model3DData* model, Model3DTextur* texture, int maxHp);
-	virtual ~Block();
-
-	void api(char* message);
-	bool isTransparent() const;
-	void setLightData(Direction dir, unsigned char* data);
-	bool isVisible() const;
-
-	Vec3<int> getLocation() const;
-	const BlockType* zBlockType() const;
-	Textur* zEffectTextur() override;
-	float getEffectPercentage() override;
-	friend Chunk;
-	Text printLightInfo();
-};

+ 0 - 396
enc_temp_folder/21617dc069ecd3eaef31d6ce92fc56e5/InventoryView.cpp

@@ -1,396 +0,0 @@
-#include <XML.h>
-#include <Bild.h>
-
-#include "InventoryView.h"
-#include "Globals.h"
-#include "DragController.h"
-#include "Globals.h"
-#include "Game.h"
-#include "UIMLToolTip.h"
-
-using namespace Framework;
-
-InventoryElement::InventoryElement()
-	: UIMLElement()
-{}
-
-//! prüft, ob dieses UIML Element für ein bestimmtes xml Element zuständig ist
-bool InventoryElement::isApplicableFor(Framework::XML::Element& element)
-{
-	return element.getName().istGleich("inventory");
-}
-
-//! erstellt eine neue Zeichnung zu einem gegebenen xml Element
-Framework::Zeichnung* InventoryElement::parseElement(Framework::XML::Element& element, Framework::UIMLContainer& generalFactory)
-{
-	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>>(Framework::VecN<int, 4>({ (int)*first, (int)*second, (int)*third, (int)*forth }));
-		first->release();
-		second->release();
-		third->release();
-		forth->release();
-	}
-	return new InventoryView(element.getAttributeValue("id"), target, (int)element.getAttributeValue("rowSize"), element.getAttributeValue("slotNameFilter"));
-}
-
-//! wendet die layout parameter zu einer Zeichnung an
-void InventoryElement::layout(Framework::XML::Element& element, Framework::Zeichnung& z, int pWidth, int pHeight, Framework::UIMLContainer& generalLayouter)
-{
-	UIMLElement::layout(element, z, pWidth, pHeight, generalLayouter);
-}
-
-
-void SlotInfo::render(int x, int y, Framework::Bild& rObj, bool selected, bool lightBackground)
-{
-	TextRenderer tr;
-	tr.setSchriftZ(dynamic_cast<Schrift*>(uiFactory.initParam.schrift->getThis()));
-	tr.setSchriftSize(12);
-	rObj.fillRegion(x, y, 52, 52, selected ? 0xFFFFFFFF : 0xFF52525E);
-	rObj.fillRegion(x + 1, y + 1, 50, 50, lightBackground ? 0xFF42424E : 0xFF222222);
-	if (itemCount > 0)
-	{
-		rObj.alphaBild(x + 1, y + 1, 50, 50, *zItem);
-		if (hp < maxHp)
-		{
-			rObj.fillRegion(x + 1, y + 47, 50, 2, 0xFF000000);
-			rObj.fillRegion(x + 1, y + 47, (int)((hp / maxHp) * 50), 2, 0xFFFFFF00);
-		}
-		if (durability < maxDurability)
-		{
-			rObj.fillRegion(x + 1, y + 49, 50, 2, 0xFF000000);
-			rObj.fillRegion(x + 1, y + 49, (int)((durability / maxDurability) * 50), 2, 0xFF00FF00);
-		}
-		const char* units[] = { "", "K", "M", "G", "T", "P" };
-		int i = 0;
-		for (; i < 6 && itemCount > 1024; i++)
-			itemCount = itemCount / 1024;
-		Text count = itemCount;
-		count += units[i];
-		tr.renderText(x + 45 - tr.getTextBreite(count), y + 45 - tr.getTextHeight(count), count, rObj, 0xFFFFFFFF);
-	}
-}
-
-
-InventoryView::InventoryView(Text id, Either<int, VecN<int, 4>> target, int rowSize, Text slotNameFilter)
-	: ZeichnungHintergrund(),
-	rowSize(rowSize),
-	target(target),
-	slotNameFilter(slotNameFilter),
-	id(id),
-	slots(0),
-	dragStartId(-1),
-	dragStopId(-1),
-	currentTooltipSlot(-1),
-	requestetTooltipSlot(-1)
-{
-	setStyle(ZeichnungHintergrund::Style::Sichtbar | ZeichnungHintergrund::Style::Erlaubt);
-	char* msg = new char[id.getLength() + slotNameFilter.getLength() + 3];
-	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(), slotNameFilter.getText(), slotNameFilter.getLength());
-	World::INSTANCE->zClient()->inventoryAPIRequest(target, msg, id.getLength() + slotNameFilter.getLength() + 3);
-	delete[] msg;
-	setNeedToolTipEvent([this](Zeichnung* z, Punkt p)
-		{
-			int slot = getSlotByLocalPos(p);
-			if (currentTooltipSlot != slot)
-			{
-				this->setToolTipZ(0);
-				currentTooltipSlot = -1;
-			}
-			else
-				return;
-			if (requestetTooltipSlot != slot)
-			{
-				requestetTooltipSlot = slot;
-				char* msg = new char[this->id.getLength() + 6];
-				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;
-				World::INSTANCE->zClient()->inventoryAPIRequest(this->target, msg, this->id.getLength() + 6);
-			}
-		});
-}
-
-InventoryView::~InventoryView()
-{
-	DragController<InventoryDragSource, int>* controller = ((Game*)(Menu*)menuRegister->get("game"))->zInventoryDragController();
-	if (controller->getCurrentDragContainer() == this)
-		controller->stopDrag();
-	if (slots)
-		slots->release();
-	char* msg = new char[id.getLength() + 2];
-	msg[0] = 1;
-	msg[1] = (char)id.getLength();
-	memcpy(msg + 2, id.getText(), id.getLength());
-	World::INSTANCE->zClient()->inventoryAPIRequest(target, msg, id.getLength() + 2);
-	delete[] msg;
-}
-
-int InventoryView::getSlotByLocalPos(Punkt pos)
-{
-	int x = 0;
-	int y = 0;
-	int rowCount = 0;
-	int slot = 0;
-	dragStopId = -1;
-	if (slots)
-	{
-		for (SlotInfo &info : *slots)
-		{
-			if (pos.x >= x && pos.x < x + 50 && pos.y >= y && pos.y < y + 50)
-				return info.id;
-			x += 60;
-			if (++rowCount >= rowSize)
-			{
-				y += 60;
-				x = 0;
-				rowCount = 0;
-			}
-			slot++;
-		}
-	}
-	return -1;
-}
-
-void InventoryView::api(char* message)
-{
-	switch (message[0])
-	{
-	case 0:
-		// send inventory content
-	{
-		Array<SlotInfo>* slots = new Array<SlotInfo>();
-		int count = *(int*)(++message);
-		for (int i = 0; i < count; i++)
-		{
-			SlotInfo info;
-			info.id = *(int*)(message += 4);
-			info.itemCount = *(int*)(message += 4);
-			if (info.itemCount > 0)
-			{
-				info.hp = *(float*)(message += 4);
-				info.maxHp = *(float*)(message += 4);
-				info.durability = *(float*)(message += 4);
-				info.maxDurability = *(float*)(message += 4);
-                info.zItem = zItemType(*(int*)(message += 4))->zIcon();
-			}
-			slots->add(info);
-		}
-		postAction([this, slots]()
-			{
-				if (this->slots)
-					this->slots->release();
-				this->slots = slots;
-			});
-		break;
-	}
-	case 1: // set count of items
-	{
-		if (!slots)
-			return;
-		int id = *(int*)(message + 1);
-		int count = *(int*)(message + 5);
-		for (int i = 0; i < slots->getEintragAnzahl(); i++)
-		{
-			if (slots->get(i).id == id)
-			{
-				SlotInfo info = slots->get(i);
-				info.itemCount = count;
-				if (info.itemCount == 0)
-				{
-					DragController<InventoryDragSource, int>* controller = ((Game*)(Menu*)menuRegister->get("game"))->zInventoryDragController();
-					if (controller && controller->getCurrentDragContainer() == this && controller->getCurrentDaragElement() == info.id)
-					{
-						controller->stopDrag();
-					}
-				}
-				slots->set(info, i);
-				break;
-			}
-		}
-		break;
-	}
-	case 2: // add new stack
-	{
-		if (!slots)
-			return;
-		int id = *(int*)(message + 1);
-		for (int i = 0; i < slots->getEintragAnzahl(); i++)
-		{
-			if (slots->get(i).id == id)
-			{
-				SlotInfo info = slots->get(i);
-				info.itemCount = *(int*)(message + 5);
-				info.hp = *(float*)(message + 9);
-				info.maxHp = *(float*)(message + 13);
-				info.durability = *(float*)(message + 17);
-				info.maxDurability = *(float*)(message + 21);
-                info.zItem = zItemType(*(int*)(message + 25))->zIcon();
-				slots->set(info, i);
-				break;
-			}
-		}
-		break;
-	}
-	case 3: // receive tooltip uiml
-	{
-		int slotId = *(int*)(message + 1);
-		if (slotId == requestetTooltipSlot)
-		{
-			short len = *(short*)(message + 5);
-			char* uiml = new char[len + 1];
-			memcpy(uiml, message + 7, len);
-			uiml[len] = 0;
-			UIMLToolTip* tip = new UIMLToolTip();
-			tip->setUIML(uiml);
-			setToolTipZ(tip);
-			delete[] uiml;
-			currentTooltipSlot = slotId;
-			requestetTooltipSlot = -1;
-		}
-	}
-	}
-}
-
-bool InventoryView::tick(double tickVal)
-{
-	return ZeichnungHintergrund::tick(tickVal);
-}
-
-void InventoryView::render(Bild& rObj)
-{
-	ZeichnungHintergrund::render(rObj);
-	if (!rObj.setDrawOptions(pos.x, pos.y, gr.x, gr.y))
-		return;
-	if (slots)
-	{
-		int x = 0;
-		int y = 0;
-		int rowCount = 0;
-		for (SlotInfo info : *slots)
-		{
-			info.render(x, y, rObj, dragStartId == info.id, dragStopId == info.id);
-			x += 60;
-			if (++rowCount >= rowSize)
-			{
-				y += 60;
-				x = 0;
-				rowCount = 0;
-			}
-		}
-	}
-	rObj.releaseDrawOptions();
-}
-
-void InventoryView::doMausEreignis(MausEreignis& me, bool userRet)
-{
-	if (!slots)
-		return;
-	if (me.id == ME_Bewegung)
-	{
-		if (getSlotByLocalPos(Punkt(me.mx, me.my)) != currentTooltipSlot)
-		{
-			setToolTipZ(0);
-			currentTooltipSlot = -1;
-		}
-	}
-	DragController<InventoryDragSource, int>* controller = ((Game*)(Menu*)menuRegister->get("game"))->zInventoryDragController();
-	int x = 0;
-	int y = 0;
-	int rowCount = 0;
-	int slot = 0;
-	dragStopId = -1;
-	for (SlotInfo info : *slots)
-	{
-		if (me.mx >= x && me.mx < x + 50 && me.my >= y && me.my < y + 50)
-		{
-			if (me.id == ME_RLinks)
-			{
-				if (!controller->getCurrentDragContainer() && info.itemCount > 0)
-				{
-					controller->beginDrag(this, info.id, info.zItem, [this]()
-						{
-							dragStartId = -1;
-						});
-					dragStartId = info.id;
-				}
-				else if (controller->getCurrentDragContainer())
-				{
-					// request to transfer items from source to target slot
-					Framework::Either<int, Framework::VecN<int, 4>> source = controller->getCurrentDragContainer()->getInventoryTarget();
-					int len = 2 + (source.isA() ? 4 : 16) + 5 + (target.isA() ? 4 : 16) + 4;
-					char* msg = new char[len];
-					int index = 0;
-					msg[index++] = 6;
-					msg[index++] = (char)source.isA();
-					if (source.isA())
-					{
-						*(int*)(msg + index) = source.getA();
-						index += 4;
-					}
-					else
-					{
-						*(int*)(msg + index) = source.getB()[0];
-						*(int*)(msg + index + 4) = source.getB()[1];
-						*(int*)(msg + index + 8) = source.getB()[2];
-						*(int*)(msg + index + 12) = source.getB()[3];
-						index += 16;
-					}
-					*(int*)(msg + index) = controller->getCurrentDaragElement();
-					index += 4;
-					msg[index++] = target.isA();
-					if (target.isA())
-					{
-						*(int*)(msg + index) = target.getA();
-						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];
-						index += 16;
-					}
-					*(int*)(msg + index) = info.id;
-					World::INSTANCE->zClient()->sendPlayerAction(msg, len);
-					delete[] msg;
-				}
-			}
-			else
-			{
-				if (controller->getCurrentDragContainer() && (controller->getCurrentDragContainer() != this || controller->getCurrentDaragElement() != info.id))
-				{
-					dragStopId = info.id;
-				}
-			}
-			break;
-		}
-		x += 60;
-		if (++rowCount >= rowSize)
-		{
-			y += 60;
-			x = 0;
-			rowCount = 0;
-		}
-		slot++;
-	}
-	ZeichnungHintergrund::doMausEreignis(me, userRet);
-}
-
-Framework::Either<int, Framework::VecN<int, 4>> InventoryView::getInventoryTarget() const
-{
-	return target;
-}

+ 0 - 466
enc_temp_folder/2259c96ab2a3916f359853f36282337/Entity.cpp

@@ -1,466 +0,0 @@
-#include <Globals.h>
-
-#include "Entity.h"
-#include "Globals.h"
-#include "Game.h"
-
-
-Entity::Entity(const EntityType* zType, Framework::Model3DData* model, Framework::Model3DTextur* texture, int id, Framework::Vec3<float> position, float maxMovementSpeed)
-	: Model3D(), id(id), zType(zType),
-	playerControlled(0),
-	maxMovementSpeed(maxMovementSpeed),
-	lastFlags(0),
-	timeSinceSync(0),
-	speed(0, 0, 0)
-{
-	pos = position;
-	setModelDaten(model);
-	setModelTextur(texture);
-	lastDirection = World::INSTANCE->zKamera()->getDirection();
-	currentFrame.duration = 0;
-	rend = 1;
-}
-
-Entity::~Entity()
-{}
-
-void Entity::api(char* message)
-{
-	switch (message[0])
-	{
-	case 0:
-	{ // add movement frame
-		if (!playerControlled)
-		{
-			MovementFrame frame;
-			frame.direction.x = *(float*)(message += 1);
-			frame.direction.y = *(float*)(message += 4);
-			frame.direction.z = *(float*)(message += 4);
-			frame.targetPosition.x = *(float*)(message += 4);
-			frame.targetPosition.y = *(float*)(message += 4);
-			frame.targetPosition.z = *(float*)(message += 4);
-			frame.movementFlags = *(int*)(message += 4);
-			frame.duration = *(double*)(message += 4);
-			cs.lock();
-			movements.add(frame);
-			cs.unlock();
-		}
-		break;
-	}
-	case 1:
-	{ // position correction
-		if (playerControlled)
-		{
-			timeSinceSync = 0;
-			pos.x = *(float*)(message += 1);
-			pos.y = *(float*)(message += 4);
-			pos.z = *(float*)(message += 4);
-			lastDirection = World::INSTANCE->zKamera()->getDirection();
-			lastFlags = 0;
-		}
-		break;
-	}
-	}
-}
-
-bool Entity::tick(double time)
-{
-	if (playerControlled && GetForegroundWindow() == window->getFensterHandle())
-	{
-		Vec3<float> direction = World::INSTANCE->zKamera()->getDirection();
-		Vec3<float> lastPos = pos;
-		int flags = 0;
-		speed = { 0, 0, speed.z };
-		if (GetKeyState('w') & 0x8000 || GetKeyState('W') & 0x8000)
-		{
-			flags |= 1;
-			speed += {direction.x, direction.y, 0};
-		}
-		if (GetKeyState('a') & 0x8000 || GetKeyState('A') & 0x8000)
-		{
-			flags |= 2;
-			Vec2<float> norm = { direction.x, direction.y };
-			norm.CCW90().normalize();
-			speed += {norm.x, norm.y, 0};
-		}
-		if (GetKeyState('s') & 0x8000 || GetKeyState('S') & 0x8000)
-		{
-			flags |= 4;
-			speed += {-direction.x, -direction.y, 0};
-		}
-		if (GetKeyState('d') & 0x8000 || GetKeyState('D') & 0x8000)
-		{
-			flags |= 8;
-			Vec2<float> norm = { direction.x, direction.y };
-			norm.CW90().normalize();
-			speed += {norm.x, norm.y, 0};
-		}
-		if (GetKeyState(T_Shift) & 0x8000)
-		{
-			flags |= 16;
-			speed.z = -maxMovementSpeed;
-		}
-		else if (GetKeyState(T_Space) & 0x8000)
-		{
-			flags |= 32;
-			speed.z = maxMovementSpeed;
-		}
-		else
-		{
-			speed.z = 0.f;
-		}
-		Vec2<float> norm = { speed.x, speed.y };
-		if (norm.getLengthSq() != 0)
-		{
-			norm.normalize();
-			speed.x = norm.x * maxMovementSpeed;
-			speed.y = norm.y * maxMovementSpeed;
-		}
-		// collision checking
-		Vec3<float> minP = model->getMinPos();
-		Vec3<float> maxP = model->getMaxPos();
-		Vec3<float> worldBoundingBox[8];
-		worldBoundingBox[0] = applyWorldTransformation(minP);
-		worldBoundingBox[1] = applyWorldTransformation({ minP.x, minP.y, maxP.z });
-		worldBoundingBox[2] = applyWorldTransformation({ minP.x, maxP.y, minP.z });
-		worldBoundingBox[3] = applyWorldTransformation({ maxP.x, minP.y, minP.z });
-		worldBoundingBox[4] = applyWorldTransformation({ maxP.x, minP.y, maxP.z });
-		worldBoundingBox[5] = applyWorldTransformation({ maxP.x, maxP.y, minP.z });
-		worldBoundingBox[6] = applyWorldTransformation({ minP.x, maxP.y, maxP.z });
-		worldBoundingBox[7] = applyWorldTransformation(maxP);
-		Vec3<float> worldBoundingBoxFloor[8];
-		for (int i = 0; i < 8; i++)
-		{
-			worldBoundingBoxFloor[i] = Vec3<float>(floor(worldBoundingBox[i].x), floor(worldBoundingBox[i].y), floor(worldBoundingBox[i].z));
-		}
-		Vec3<float> frameSpeed = speed * (float)time;
-		bool hasCollided = 0;
-		while (true)
-		{
-			float tf = 1.f;
-			int collType = 0;
-			int updateType = 0;
-			int updateI = 0;
-			if (frameSpeed.x > 0)
-			{
-				for (int i = 0; i < 8; i++)
-				{
-					if (abs(frameSpeed.x) >= abs(worldBoundingBoxFloor[i].x + 1.f - worldBoundingBox[i].x))
-					{
-						float xt = (worldBoundingBoxFloor[i].x + 1.f - worldBoundingBox[i].x) / frameSpeed.x;
-						Vec3<float> tmp = worldBoundingBox[i] + frameSpeed * xt;
-						if (tmp.y >= worldBoundingBoxFloor[i].y && tmp.y < worldBoundingBoxFloor[i].y + 1.f && tmp.z >= worldBoundingBoxFloor[i].z && tmp.z < worldBoundingBoxFloor[i].z + 1.f)
-						{
-							Block* b = World::INSTANCE->zBlockAt(Vec3<int>{ (int)worldBoundingBoxFloor[i].x + 1, (int)worldBoundingBoxFloor[i].y, (int)worldBoundingBoxFloor[i].z });
-							if (b) // TODO: ignore passable blocks
-							{
-								if (xt < tf)
-								{
-									tf = xt;
-									collType = 1;
-									updateType = 0;
-								}
-								hasCollided = 1;
-							}
-							else
-							{
-								if (xt < tf)
-								{
-									tf = xt;
-									collType = 0;
-									updateType = 1;
-									updateI = i;
-								}
-							}
-						}
-					}
-				}
-			}
-			if (frameSpeed.x < 0)
-			{
-				for (int i = 0; i < 8; i++)
-				{
-					if (abs(frameSpeed.x) >= abs(worldBoundingBoxFloor[i].x - worldBoundingBox[i].x))
-					{
-						float xt = (worldBoundingBoxFloor[i].x - worldBoundingBox[i].x) / frameSpeed.x;
-						Vec3<float> tmp = worldBoundingBox[i] + frameSpeed * xt;
-						if (tmp.y >= worldBoundingBoxFloor[i].y && tmp.y < worldBoundingBoxFloor[i].y + 1.f && tmp.z >= worldBoundingBoxFloor[i].z && tmp.z < worldBoundingBoxFloor[i].z + 1.f)
-						{
-							Block* b = World::INSTANCE->zBlockAt(Vec3<int>{ (int)worldBoundingBoxFloor[i].x - 1, (int)worldBoundingBoxFloor[i].y, (int)worldBoundingBoxFloor[i].z });
-							if (b) // TODO: ignore passable blocks
-							{
-								if (xt < tf)
-								{
-									tf = xt;
-									collType = 1;
-									updateType = 0;
-								}
-								hasCollided = 1;
-							}
-							else
-							{
-								if (xt < tf)
-								{
-									tf = xt;
-									collType = 0;
-									updateType = 1;
-									updateI = i;
-								}
-							}
-						}
-					}
-				}
-			}
-			if (frameSpeed.y > 0)
-			{
-				for (int i = 0; i < 8; i++)
-				{
-					if (abs(frameSpeed.y) >= abs(worldBoundingBoxFloor[i].y + 1.f - worldBoundingBox[i].y))
-					{
-						float yt = (worldBoundingBoxFloor[i].y + 1.f - worldBoundingBox[i].y) / frameSpeed.y;
-						Vec3<float> tmp = worldBoundingBox[i] + frameSpeed * yt;
-						if (tmp.x >= worldBoundingBoxFloor[i].x && tmp.x < worldBoundingBoxFloor[i].x + 1.f && tmp.z >= worldBoundingBoxFloor[i].z && tmp.z < worldBoundingBoxFloor[i].z + 1.f)
-						{
-							Block* b = World::INSTANCE->zBlockAt(Vec3<int>{ (int)worldBoundingBoxFloor[i].x, (int)worldBoundingBoxFloor[i].y + 1, (int)worldBoundingBoxFloor[i].z });
-							if (b) // TODO: ignore passable blocks
-							{
-								if (yt < tf)
-								{
-									tf = yt;
-									collType = 2;
-									updateType = 0;
-								}
-								hasCollided = 1;
-							}
-							else
-							{
-								if (yt < tf)
-								{
-									tf = yt;
-									collType = 0;
-									updateType = 2;
-									updateI = i;
-								}
-							}
-						}
-					}
-				}
-			}
-			if (frameSpeed.y < 0)
-			{
-				for (int i = 0; i < 8; i++)
-				{
-					if (abs(frameSpeed.y) >= abs(worldBoundingBoxFloor[i].y - worldBoundingBox[i].y))
-					{
-						float yt = (worldBoundingBoxFloor[i].y - worldBoundingBox[i].y) / frameSpeed.y;
-						Vec3<float> tmp = worldBoundingBox[i] + frameSpeed * yt;
-						if (tmp.x >= worldBoundingBoxFloor[i].x && tmp.x < worldBoundingBoxFloor[i].x + 1.f && tmp.z >= worldBoundingBoxFloor[i].z && tmp.z < worldBoundingBoxFloor[i].z + 1.f)
-						{
-							Block* b = World::INSTANCE->zBlockAt(Vec3<int>{ (int)worldBoundingBoxFloor[i].x, (int)worldBoundingBoxFloor[i].y - 1, (int)worldBoundingBoxFloor[i].z });
-							if (b) // TODO: ignore passable blocks
-							{
-								if (yt < tf)
-								{
-									tf = yt;
-									collType = 2;
-									updateType = 0;
-								}
-								hasCollided = 1;
-							}
-							else
-							{
-								if (yt < tf)
-								{
-									tf = yt;
-									collType = 0;
-									updateType = 2;
-									updateI = i;
-								}
-							}
-						}
-					}
-				}
-			}
-			if (frameSpeed.z > 0)
-			{
-				for (int i = 0; i < 8; i++)
-				{
-					if (abs(frameSpeed.z) >= abs(worldBoundingBoxFloor[i].z + 1.f - worldBoundingBox[i].z))
-					{
-						float zt = (worldBoundingBoxFloor[i].z + 1.f - worldBoundingBox[i].z) / frameSpeed.z;
-						Vec3<float> tmp = worldBoundingBox[i] + frameSpeed * zt;
-						if (zt <= 1.f && tmp.x >= worldBoundingBoxFloor[i].x && tmp.x < worldBoundingBoxFloor[i].x + 1.f && tmp.y >= worldBoundingBoxFloor[i].y && tmp.y < worldBoundingBoxFloor[i].y + 1.f)
-						{
-							Block* b = World::INSTANCE->zBlockAt(Vec3<int>{ (int)worldBoundingBoxFloor[i].x, (int)worldBoundingBoxFloor[i].y, (int)worldBoundingBoxFloor[i].z + 1 });
-							if (b) // TODO: ignore passable blocks
-							{
-								if (zt < tf)
-								{
-									tf = zt;
-									collType = 3;
-								}
-								hasCollided = 1;
-							}
-							else
-							{
-								if (zt < tf)
-								{
-									tf = zt;
-									collType = 0;
-									updateType = 3;
-									updateI = i;
-								}
-							}
-						}
-					}
-				}
-			}
-			if (frameSpeed.z < 0)
-			{
-				for (int i = 0; i < 8; i++)
-				{
-					if (abs(frameSpeed.z) >= abs(worldBoundingBoxFloor[i].z - worldBoundingBox[i].z))
-					{
-						float zt = (worldBoundingBoxFloor[i].z - worldBoundingBox[i].z) / frameSpeed.z;
-						Vec3<float> tmp = worldBoundingBox[i] + frameSpeed * zt;
-						if (tmp.x >= worldBoundingBoxFloor[i].x && tmp.x < worldBoundingBoxFloor[i].x + 1.f && tmp.y >= worldBoundingBoxFloor[i].y && tmp.y < worldBoundingBoxFloor[i].y + 1)
-						{
-							Block* b = World::INSTANCE->zBlockAt(Vec3<int>{ (int)worldBoundingBoxFloor[i].x, (int)worldBoundingBoxFloor[i].y, (int)worldBoundingBoxFloor[i].z - 1 });
-							if (b) // TODO: ignore passable blocks
-							{
-								if (zt < tf)
-								{
-									tf = zt;
-									collType = 3;
-									updateType = 0;
-								}
-								hasCollided = 1;
-							}
-							else
-							{
-								if (zt < tf)
-								{
-									tf = zt;
-									collType = 0;
-									updateType = 3;
-									updateI = i;
-								}
-							}
-						}
-					}
-				}
-			}
-			if (collType == 1)
-				frameSpeed.x = tf > 0.1f ? frameSpeed.x * (tf - 0.1f) : 0.f;
-			if (collType == 2)
-				frameSpeed.y = tf > 0.1f ? frameSpeed.y * (tf - 0.1f) : 0.f;
-			if (collType == 3)
-				frameSpeed.z = tf > 0.1f ? frameSpeed.z * (tf - 0.1f) : 0.f;
-			if (updateType == 1)
-			{
-				if ((int)worldBoundingBoxFloor[updateI].x < (int)floor(worldBoundingBox[updateI].x + frameSpeed.x))
-					worldBoundingBoxFloor[updateI].x++;
-				if ((int)worldBoundingBoxFloor[updateI].x > (int)floor(worldBoundingBox[updateI].x + frameSpeed.x))
-					worldBoundingBoxFloor[updateI].x--;
-			}
-			if (updateType == 2)
-			{
-				if ((int)worldBoundingBoxFloor[updateI].y < (int)floor(worldBoundingBox[updateI].y + frameSpeed.y))
-					worldBoundingBoxFloor[updateI].y++;
-				if ((int)worldBoundingBoxFloor[updateI].y > (int)floor(worldBoundingBox[updateI].y + frameSpeed.y))
-					worldBoundingBoxFloor[updateI].y--;
-			}
-			if (updateType == 3)
-			{
-				if ((int)worldBoundingBoxFloor[updateI].z < (int)floor(worldBoundingBox[updateI].z + frameSpeed.z))
-					worldBoundingBoxFloor[updateI].z++;
-				if ((int)worldBoundingBoxFloor[updateI].z > (int)floor(worldBoundingBox[updateI].z + frameSpeed.z))
-					worldBoundingBoxFloor[updateI].z--;
-			}
-			if (updateType || collType)
-				continue;
-			break;
-		}
-		pos += frameSpeed;
-		World::INSTANCE->zKamera()->setPosition(pos + Vec3<float>(0.f, 0.f, 1.5f));
-		Model3D* target = World::INSTANCE->getCurrentTarget();
-		Block* b = target ? dynamic_cast<Block*>(target) : 0;
-		((Game*)(Menu*)menuRegister->get("game"))->updatePosition(pos, b != 0, b ? b->getLocation() : Vec3<int>(0, 0, 0));
-		if(target)
-			target->release();
-		if (flags != lastFlags || direction != lastDirection || timeSinceSync >= 1 || hasCollided)
-		{
-			if (timeSinceSync > 0)
-			{
-				MovementFrame frame;
-				frame.direction = lastDirection;
-				frame.targetPosition = lastPos;
-				frame.movementFlags = lastFlags;
-				frame.duration = timeSinceSync;
-				World::INSTANCE->zClient()->sendPlayerMovement(frame);
-			}
-			lastFlags = flags;
-			lastDirection = direction;
-			timeSinceSync = 0;
-		}
-		timeSinceSync += time;
-		rend = 1;
-	}
-	else
-	{
-		double totalTime = time;
-		while (totalTime > 0)
-		{
-			if (currentFrame.duration <= 0)
-			{
-				if (movements.getEintragAnzahl() > 0)
-				{
-					currentFrame = movements.get(0);
-					cs.lock();
-					movements.remove(0);
-					cs.unlock();
-				}
-				else
-				{
-					break;
-				}
-			}
-			double t = min(currentFrame.duration, totalTime);
-			pos += (currentFrame.targetPosition - pos) * (float)(t / currentFrame.duration);
-			currentFrame.duration -= t;
-			totalTime -= t;
-			if (currentFrame.duration <= 0)
-			{
-				pos = currentFrame.targetPosition;
-			}
-			rend = 1;
-		}
-	}
-	return Model3D::tick(time);
-}
-
-int Entity::getId() const
-{
-	return id;
-}
-
-const EntityType* Entity::zEntityType() const
-{
-	return zType;
-}
-
-void Entity::lock()
-{
-	cs.lock();
-}
-
-void Entity::unlock()
-{
-	cs.unlock();
-}
-
-void Entity::setPlayerControlled()
-{
-	playerControlled = 1;
-	World::INSTANCE->zKamera()->setPosition(pos + Vec3<float>(0.f, 0.f, 1.5f));
-}

+ 0 - 14
enc_temp_folder/2732994fb4435f576fdce2c1194fde8/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)

+ 0 - 31
enc_temp_folder/29ba8b78dd7e83ca667f1499ba935536/Initialisierung.h

@@ -1,31 +0,0 @@
-#ifndef Initialisierung_H
-#define Initialisierung_H
-
-#include <Knopf.h>
-#include <Bild.h>
-#include <AuswahlBox.h>
-#include <Tabelle.h>
-#include <Diagramm.h>
-#include <Fortschritt.h>
-#include <initializer_list>
-
-using namespace Framework;
-
-struct OBJTabelleSpalteIni
-{
-	char* name;
-	int breite;
-	int minBreite;
-	int maxBreite;
-};
-
-Knopf* initKnopf(int x, int y, int br, int hö, __int64 style, char* titel);
-KontrollKnopf* initKontrollKnopf(int x, int y, int br, int hö, __int64 style, char* txt);
-TextFeld* initTextFeld(int x, int y, int br, int hö, __int64 style, char* txt);
-BildZ* initBildZ(int x, int y, int br, int hö, __int64 style, Bild* b);
-AuswahlBox* initAuswahlBox(int x, int y, int br, int hö, __int64 style, std::initializer_list< char* > values);
-ObjTabelle* initObjTabelle(int x, int y, int br, int hö, __int64 style, std::initializer_list< OBJTabelleSpalteIni > spalten, int überschriftHöhe);
-LDiag* initLinienDiagramm(int x, int y, int br, int hö, __int64 style, DiagDaten* data);
-FBalken* initFBalken(int x, int y, int br, int hö, __int64 style);
-
-#endif

+ 0 - 44
enc_temp_folder/2e3f6cd4bfac3bffdfa7e916c1b6a19/EntityType.cpp

@@ -1,44 +0,0 @@
-#include "EntityType.h"
-#include "Entity.h"
-#include "Registries.h"
-#include "Globals.h"
-
-
-EntityType::EntityType(int id, ModelInfo model)
-	: id(id),
-	model(model)
-{}
-
-Entity* EntityType::loadEntity(Framework::StreamReader* zReader) const
-{
-	int id;
-	zReader->lese((char*)&id, 4);
-	Framework::Vec3<float> position;
-	zReader->lese((char*)&position.x, 4);
-	zReader->lese((char*)&position.y, 4);
-	zReader->lese((char*)&position.z, 4);
-	float maxSpeed;
-	zReader->lese((char*)&maxSpeed, 4);
-	bool specialModel = 0;
-	zReader->lese((char*)&specialModel, 1);
-	Entity* e;
-	if (specialModel)
-	{
-		ModelInfo model(zReader);
-		e = new Entity(this, model.getModel(), model.getTexture(), id, position, maxSpeed);
-	}
-	else
-	{
-		e = new Entity(this, model.getModel(), model.getTexture(), id, position, maxSpeed);
-	}
-	if (World::INSTANCE->zKamera()->getEntityId() == id)
-	{
-		e->setPlayerControlled();
-	}
-	return e;
-}
-
-int EntityType::getId() const
-{
-	return id;
-}

+ 0 - 19
enc_temp_folder/2fdfb0b658ed7fdeeb462a6c24ece4/AddServerMenu.h

@@ -1,19 +0,0 @@
-#pragma once
-
-#include <TextFeld.h>
-#include <Knopf.h>
-#include "Menu.h"
-
-class AddServerMenu : public Menu
-{
-private:
-	Framework::TextFeld* name;
-	Framework::TextFeld* address;
-	Framework::TextFeld* sslPort;
-	Framework::TextFeld* port;
-	Framework::Knopf* add;
-	Framework::Knopf* abort;
-
-public:
-	AddServerMenu(Framework::Bildschirm* zScreen);
-};

+ 0 - 37
enc_temp_folder/3112d9feb6108e97e3d1601255838b8e/ItemBar.h

@@ -1,37 +0,0 @@
-#pragma once
-
-#include <UIMLView.h>
-#include <Either.h>
-
-#include "NetworkAPIProcessor.h"
-#include "InventoryView.h"
-
-
-class ItemBarElement : public Framework::UIMLElement
-{
-public:
-	ItemBarElement();
-	//! prüft, ob dieses UIML Element für ein bestimmtes xml Element zuständig ist
-	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;
-	//! wendet die layout parameter zu einer Zeichnung an
-	void layout(Framework::XML::Element& element, Framework::Zeichnung& z, int pWidth, int pHeight, Framework::UIMLContainer& generalLayouter) override;
-};
-
-class ItemBarView : public Framework::ZeichnungHintergrund, public NetworkAPIProcessor
-{
-private:
-	Framework::Text id;
-	int rowSize;
-	int targetEntity;
-	Framework::Text slotNameFilter;
-	Framework::Array<SlotInfo>* slots;
-	int leftHandPos;
-
-public:
-	ItemBarView(Framework::Text id, int rowSize, int targetEntity, Framework::Text slotNameFilter);
-	~ItemBarView();
-	void api(char* message) override;
-	void render(Framework::Bild& rObj) override;
-};

+ 0 - 16
enc_temp_folder/316083384fb252cde515408067a06dd5/Load.h

@@ -1,16 +0,0 @@
-#pragma once
-
-#include <Fortschritt.h>
-#include "Menu.h"
-#undef LoadMenu
-
-class LoadMenu : public Menu
-{
-private:
-	FBalken* step;
-	FBalken* stage;
-	FBalken* all;
-
-public:
-	LoadMenu(Bildschirm* zScreen);
-};

+ 0 - 252
enc_temp_folder/316650b8b86a35dbcc28e142c50b2ba/Dimension.cpp

@@ -1,252 +0,0 @@
-#include "Dimension.h"
-#include "Constants.h"
-#include "Datei.h"
-#include "Game.h"
-#include "Globals.h"
-#include "World.h"
-
-using namespace Framework;
-
-Dimension::Dimension()
-	: chunks(new Trie<Chunk>()),
-	entities(new RCArray<Entity>())
-{}
-
-Dimension::~Dimension()
-{
-	entities->release();
-	chunks->release();
-}
-
-void Dimension::getAddrOf(Punkt cPos, char* addr) const
-{
-	*(int*)addr = cPos.x;
-	*((int*)addr + 1) = cPos.y;
-}
-
-void Dimension::getAddrOfWorld(Punkt wPos, char* addr) const
-{
-	if (wPos.x < 0)
-		wPos.x -= CHUNK_SIZE;
-	if (wPos.y < 0) // needed because otherwise would (-8, -8) have the same adress as (8, 8)
-		wPos.y -= CHUNK_SIZE;
-	wPos /= CHUNK_SIZE;
-	getAddrOf(wPos, addr);
-}
-
-void Dimension::api(char* message)
-{
-	switch (message[0])
-	{
-	case 1: // chunck
-	{
-		int cX = *(int*)(message + 1);
-		int cY = *(int*)(message + 5);
-		Chunk* ch = zChunk(Punkt(cX, cY));
-		if (ch)
-			ch->api(message + 9);
-		break;
-	}
-	case 2: // entity
-	{
-		int eId = *(int*)(message + 1);
-		Entity* e = zEntity(eId);
-		if (e)
-			e->api(message + 5);
-		break;
-	}
-	case 3: // block
-	{
-		int px = *(int*)(message + 1);
-		int py = *(int*)(message + 5);
-		int pz = *(int*)(message + 9);
-		Block* b = zBlock(Framework::Vec3<int>(px, py, pz));
-		if (b)
-			b->api(message + 13);
-		break;
-	}
-	case 4: // add new chunck
-	{
-		Punkt center;
-		center.x = *(int*)(message + 1);
-		center.y = *(int*)(message + 5);
-		ByteArrayReader reader(message + 9, INT_MAX, 0);
-		std::cout << "downloading chunk " << center.x << ", " << center.y << "\n";
-		ZeitMesser zm;
-		zm.messungStart();
-		Chunk* chunk = new Chunk(center);
-		chunk->load(&reader);
-		zm.messungEnde();
-		std::cout << "chunk loading took " << zm.getSekunden() << " seconds\n";
-		setChunk(chunk, center);
-		World::INSTANCE->onChunkAdded(center);
-		break;
-	}
-	}
-}
-
-Chunk* Dimension::zChunk(Punkt wPos) const
-{
-	char addr[8];
-	getAddrOfWorld(wPos, addr);
-	return chunks->z(addr, 8);
-}
-
-Block* Dimension::zBlock(Vec3<int> location)
-{
-	Chunk* c = zChunk(World::INSTANCE->getChunkCenter(location.x, location.y));
-	if (c)
-		return c->zBlockAt(location);
-	return 0;
-}
-
-Block* Dimension::getBlock(Vec3<int> location)
-{
-	cs.lock();
-	Chunk* c = zChunk(World::INSTANCE->getChunkCenter(location.x, location.y));
-	if (c)
-	{
-		Block* b = c->zBlockAt(location);
-		b = b ? dynamic_cast<Block*>(b->getThis()) : 0;
-		cs.unlock();
-		return b;
-	}
-	cs.unlock();
-	return 0;
-}
-
-void Dimension::addEntity(Entity* entity)
-{
-	entities->add(entity);
-	World::INSTANCE->setVisibility(entity, 1);
-}
-
-void Dimension::setChunk(Chunk* chunk, Punkt center)
-{
-	char addr[8];
-	getAddrOfWorld(center, addr);
-	Chunk* old = chunks->z(addr, 8);
-	cs.lock();
-	if (old)
-	{
-		World::INSTANCE->setVisibility(old, 0);
-		int index = 0;
-		for (auto iterator = chunkList.begin(); iterator; ++iterator, ++index)
-		{
-			if ((Chunk*)iterator == old)
-			{
-				if (chunk)
-					iterator.set(chunk);
-				else
-					chunkList.remove(index);
-				break;
-			}
-		}
-	}
-	else if (chunk)
-		chunkList.add(chunk);
-	chunks->set(addr, 8, chunk);
-	if (chunk)
-		chunk->getThis();
-	cs.unlock();
-	if (chunk)
-	{
-		World::INSTANCE->setVisibility(chunk, 1);
-		chunk->release();
-	}
-}
-
-bool Dimension::hasChunck(int x, int y) const
-{
-	return zChunk(Punkt(x, y));
-}
-
-void Dimension::removeDistantChunks(Punkt wPos)
-{
-	Array<int> removed;
-	int index = 0;
-	for (Chunk* chunk : chunkList)
-	{
-		if ((chunk->getCenter() - wPos).getLength() > MAX_VIEW_DISTANCE * 2)
-			removed.add(index, 0);
-		index++;
-	}
-	for (int i : removed)
-	{
-		Chunk* chunk = chunkList.get(i);
-		World::INSTANCE->setVisibility(chunk, 0);
-		setChunk(0, chunk->getCenter());
-	}
-}
-
-void Dimension::setBlock(Block* block)
-{
-	cs.lock();
-	Chunk* c = zChunk(World::INSTANCE->getChunkCenter((int)floor(block->getPos().x), (int)floor(block->getPos().y)));
-	if (c)
-		c->setBlock(block);
-	else
-		block->release();
-	cs.unlock();
-}
-
-void Dimension::removeBlock(Block* zBlock)
-{
-	cs.lock();
-	Chunk* c = zChunk(World::INSTANCE->getChunkCenter((int)floor(zBlock->getPos().x), (int)floor(zBlock->getPos().y)));
-	if (c)
-		c->removeBlock(zBlock);
-	cs.unlock();
-}
-
-Entity* Dimension::zEntity(int id)
-{
-	cs.lock();
-	for (Entity* e : *entities)
-	{
-		if (e->getId() == id)
-		{
-			cs.unlock();
-			return e;
-		}
-	}
-	cs.unlock();
-	return 0;
-}
-
-Entity* Dimension::getEntity(int id)
-{
-	cs.lock();
-	for (Entity* e : *entities)
-	{
-		if (e->getId() == id)
-		{
-			Entity* result = dynamic_cast<Entity*>(e->getThis());
-			cs.unlock();
-			return result;
-		}
-	}
-	cs.unlock();
-	return 0;
-}
-
-void Dimension::removeEntity(int id)
-{
-	World::INSTANCE->lockWorld();
-	cs.lock();
-	int index = 0;
-	for (Entity* e : *entities)
-	{
-		if (e->getId() == id)
-		{
-			World::INSTANCE->setVisibility(e, 0);
-			entities->remove(index);
-			cs.unlock();
-			World::INSTANCE->unlockWorld();
-			return;
-		}
-		index++;
-	}
-	cs.unlock();
-	World::INSTANCE->unlockWorld();
-}

+ 0 - 68
enc_temp_folder/33937a68c5128732d77739a9e125756/StaticRegistry.h

@@ -1,68 +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;
-};

+ 0 - 553
enc_temp_folder/3a55cd8d8af5f8ea2a64d516d5bc5692/Load.cpp

@@ -1,553 +0,0 @@
-#include <AsynchronCall.h>
-#include <Datei.h>
-#include <Array.h>
-#include <DateiSystem.h>
-#include <Text.h>
-#include <Textur.h>
-#include <GraphicsApi.h>
-#include <M3Datei.h>
-
-#include "Load.h"
-#include "Initialisierung.h"
-#include "Globals.h"
-#include "ServerSelection.h"
-
-void createDefaultCube(Bildschirm* zScreen)
-{
-	Model3DData* data = zScreen->zGraphicsApi()->createModel("cube");
-	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.
-	left = (float)((-size / 2.0));
-	// Calculate the screen coordinates of the right side of the bitmap.
-	right = left + (float)size;
-	// Calculate the screen coordinates of the top of the bitmap.
-	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[1].pos = Vec3<float >(right, front, top);
-	vertecies[1].tPos = Vec2< float >(1.f, 0.f);
-	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[5].pos = Vec3<float >(left, back, top);
-	vertecies[5].tPos = Vec2< float >(1.0f, 0.0f);
-	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[9].pos = Vec3<float >(left, front, top);
-	vertecies[9].tPos = Vec2< float >(1.f, 0.f);
-	vertecies[10].pos = Vec3<float >(left, back, bottom);
-	vertecies[10].tPos = Vec2< float >(0.f, 1.f);
-	vertecies[11].pos = Vec3<float >(left, front, bottom);
-	vertecies[11].tPos = Vec2< float >(1.f, 1.f);
-	// right side
-	vertecies[12].pos = Vec3<float >(right, front, top);
-	vertecies[12].tPos = Vec2< float >(0.0f, 0.0f);
-	vertecies[13].pos = Vec3<float >(right, back, top);
-	vertecies[13].tPos = Vec2< float >(1.0f, 0.0f);
-	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[17].pos = Vec3<float >(right, back, top);
-	vertecies[17].tPos = Vec2< float >(1.f, 0.f);
-	vertecies[18].pos = Vec3<float >(left, front, top);
-	vertecies[18].tPos = Vec2< float >(0.f, 1.f);
-	vertecies[19].pos = Vec3<float >(right, front, top);
-	vertecies[19].tPos = Vec2< float >(1.f, 1.f);
-	// botom side
-	vertecies[20].pos = Vec3<float >(left, front, bottom);
-	vertecies[20].tPos = Vec2< float >(0.0f, 0.0f);
-	vertecies[21].pos = Vec3<float >(right, 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();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0;
-	p->indexList[1] = 2;
-	p->indexList[2] = 1;
-	p->indexList[3] = 1;
-	p->indexList[4] = 2;
-	p->indexList[5] = 3;
-	data->addPolygon(p);
-	// left side
-	p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0 + 8;
-	p->indexList[1] = 2 + 8;
-	p->indexList[2] = 1 + 8;
-	p->indexList[3] = 1 + 8;
-	p->indexList[4] = 2 + 8;
-	p->indexList[5] = 3 + 8;
-	data->addPolygon(p);
-	// back side
-	p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0 + 4;
-	p->indexList[1] = 2 + 4;
-	p->indexList[2] = 1 + 4;
-	p->indexList[3] = 1 + 4;
-	p->indexList[4] = 2 + 4;
-	p->indexList[5] = 3 + 4;
-	data->addPolygon(p);
-	// right side
-	p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0 + 12;
-	p->indexList[1] = 2 + 12;
-	p->indexList[2] = 1 + 12;
-	p->indexList[3] = 1 + 12;
-	p->indexList[4] = 2 + 12;
-	p->indexList[5] = 3 + 12;
-	data->addPolygon(p);
-	// top side
-	p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0 + 16;
-	p->indexList[1] = 2 + 16;
-	p->indexList[2] = 1 + 16;
-	p->indexList[3] = 1 + 16;
-	p->indexList[4] = 2 + 16;
-	p->indexList[5] = 3 + 16;
-	data->addPolygon(p);
-	// botom side
-	p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0 + 20;
-	p->indexList[1] = 2 + 20;
-	p->indexList[2] = 1 + 20;
-	p->indexList[3] = 1 + 20;
-	p->indexList[4] = 2 + 20;
-	p->indexList[5] = 3 + 20;
-	data->addPolygon(p);
-	data->calculateNormals();
-	data->release();
-}
-
-void createCubeItem(Bildschirm* zScreen)
-{
-	Framework::Model3DData* data = window->zBildschirm()->zGraphicsApi()->createModel("itemCube");
-	data->setAmbientFactor(0.8f);
-	data->setDiffusFactor(0.1f);
-	data->setSpecularFactor(0.1f);
-	float size = 0.2f;
-	float left, right, top, bottom;
-	// Calculate the screen coordinates of the left side of the bitmap.
-	left = (float)((-size / 2.0));
-	// Calculate the screen coordinates of the right side of the bitmap.
-	right = left + (float)size;
-	// Calculate the screen coordinates of the top of the bitmap.
-	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[1].pos = Vec3<float >(right, front, top);
-	vertecies[1].tPos = Vec2< float >(1.f, 0.f);
-	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[5].pos = Vec3<float >(left, back, top);
-	vertecies[5].tPos = Vec2< float >(1.0f, 0.0f);
-	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[9].pos = Vec3<float >(left, front, top);
-	vertecies[9].tPos = Vec2< float >(1.f, 0.f);
-	vertecies[10].pos = Vec3<float >(left, back, bottom);
-	vertecies[10].tPos = Vec2< float >(0.f, 1.f);
-	vertecies[11].pos = Vec3<float >(left, front, bottom);
-	vertecies[11].tPos = Vec2< float >(1.f, 1.f);
-	// right side
-	vertecies[12].pos = Vec3<float >(right, front, top);
-	vertecies[12].tPos = Vec2< float >(0.0f, 0.0f);
-	vertecies[13].pos = Vec3<float >(right, back, top);
-	vertecies[13].tPos = Vec2< float >(1.0f, 0.0f);
-	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[17].pos = Vec3<float >(right, back, top);
-	vertecies[17].tPos = Vec2< float >(1.f, 0.f);
-	vertecies[18].pos = Vec3<float >(left, front, top);
-	vertecies[18].tPos = Vec2< float >(0.f, 1.f);
-	vertecies[19].pos = Vec3<float >(right, front, top);
-	vertecies[19].tPos = Vec2< float >(1.f, 1.f);
-	// botom side
-	vertecies[20].pos = Vec3<float >(left, front, bottom);
-	vertecies[20].tPos = Vec2< float >(0.0f, 0.0f);
-	vertecies[21].pos = Vec3<float >(right, 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();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0;
-	p->indexList[1] = 2;
-	p->indexList[2] = 1;
-	p->indexList[3] = 1;
-	p->indexList[4] = 2;
-	p->indexList[5] = 3;
-	data->addPolygon(p);
-	// left side
-	p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0 + 8;
-	p->indexList[1] = 2 + 8;
-	p->indexList[2] = 1 + 8;
-	p->indexList[3] = 1 + 8;
-	p->indexList[4] = 2 + 8;
-	p->indexList[5] = 3 + 8;
-	data->addPolygon(p);
-	// back side
-	p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0 + 4;
-	p->indexList[1] = 2 + 4;
-	p->indexList[2] = 1 + 4;
-	p->indexList[3] = 1 + 4;
-	p->indexList[4] = 2 + 4;
-	p->indexList[5] = 3 + 4;
-	data->addPolygon(p);
-	// right side
-	p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0 + 12;
-	p->indexList[1] = 2 + 12;
-	p->indexList[2] = 1 + 12;
-	p->indexList[3] = 1 + 12;
-	p->indexList[4] = 2 + 12;
-	p->indexList[5] = 3 + 12;
-	data->addPolygon(p);
-	// top side
-	p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0 + 16;
-	p->indexList[1] = 2 + 16;
-	p->indexList[2] = 1 + 16;
-	p->indexList[3] = 1 + 16;
-	p->indexList[4] = 2 + 16;
-	p->indexList[5] = 3 + 16;
-	data->addPolygon(p);
-	// botom side
-	p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0 + 20;
-	p->indexList[1] = 2 + 20;
-	p->indexList[2] = 1 + 20;
-	p->indexList[3] = 1 + 20;
-	p->indexList[4] = 2 + 20;
-	p->indexList[5] = 3 + 20;
-	data->addPolygon(p);
-	data->calculateNormals();
-	data->release();
-}
-
-void createPlayer(Bildschirm* zScreen)
-{
-	Framework::Model3DData* data = window->zBildschirm()->zGraphicsApi()->createModel("player");
-	data->setAmbientFactor(0.8f);
-	data->setDiffusFactor(0.1f);
-	data->setSpecularFactor(0.1f);
-	float size = 0.8f;
-	float left, right, top, bottom;
-	// Calculate the screen coordinates of the left side of the bitmap.
-	left = (float)((size / 2.0) * -1);
-	// Calculate the screen coordinates of the right side of the bitmap.
-	right = left + (float)size;
-	// Calculate the screen coordinates of the top of the bitmap.
-	top = (float)(size / 2.0);
-	// Calculate the screen coordinates of the bottom of the bitmap.
-	bottom = top - (float)size;
-	float front = -1.5f / 2;
-	float back = front + 1.5f;
-
-	Vertex3D* vertecies = new Vertex3D[24];
-	for (int i = 0; i < 24; i++)
-		vertecies[i].knochenId = 0;
-	vertecies[0].pos = Vec3<float >(left, top, front);
-	vertecies[0].tPos = Vec2< float >(0.f, 0.f);
-	vertecies[1].pos = Vec3<float >(right, top, front);
-	vertecies[1].tPos = Vec2< float >(1.f, 0.f);
-	vertecies[2].pos = Vec3<float >(left, bottom, front);
-	vertecies[2].tPos = Vec2< float >(0.f, 1.f);
-	vertecies[3].pos = Vec3<float >(right, bottom, front);
-	vertecies[3].tPos = Vec2< float >(1.f, 1.f);
-	vertecies[4].pos = Vec3<float >(left, top, back);
-	vertecies[4].tPos = Vec2< float >(0.0f, 0.0f);
-	vertecies[5].pos = Vec3<float >(right, top, back);
-	vertecies[5].tPos = Vec2< float >(1.0f, 0.0f);
-	vertecies[6].pos = Vec3<float >(left, bottom, back);
-	vertecies[6].tPos = Vec2< float >(0.0f, 1.0f);
-	vertecies[7].pos = Vec3<float >(right, bottom, back);
-	vertecies[7].tPos = Vec2< float >(1.0f, 1.0f);
-
-	vertecies[8].pos = Vec3<float >(left, top, front);
-	vertecies[8].tPos = Vec2< float >(1.f, 0.f);
-	vertecies[9].pos = Vec3<float >(right, top, front);
-	vertecies[9].tPos = Vec2< float >(0.f, 0.f);
-	vertecies[10].pos = Vec3<float >(left, bottom, front);
-	vertecies[10].tPos = Vec2< float >(1.f, 1.f);
-	vertecies[11].pos = Vec3<float >(right, bottom, front);
-	vertecies[11].tPos = Vec2< float >(0.f, 1.f);
-	vertecies[12].pos = Vec3<float >(left, top, back);
-	vertecies[12].tPos = Vec2< float >(0.0f, 0.0f);
-	vertecies[13].pos = Vec3<float >(right, top, back);
-	vertecies[13].tPos = Vec2< float >(1.0f, 0.0f);
-	vertecies[14].pos = Vec3<float >(left, bottom, back);
-	vertecies[14].tPos = Vec2< float >(0.0f, 1.0f);
-	vertecies[15].pos = Vec3<float >(right, bottom, back);
-	vertecies[15].tPos = Vec2< float >(1.0f, 1.0f);
-
-	vertecies[16].pos = Vec3<float >(left, top, front);
-	vertecies[16].tPos = Vec2< float >(0.f, 1.f);
-	vertecies[17].pos = Vec3<float >(right, top, front);
-	vertecies[17].tPos = Vec2< float >(1.f, 1.f);
-	vertecies[18].pos = Vec3<float >(left, bottom, front);
-	vertecies[18].tPos = Vec2< float >(0.f, 0.f);
-	vertecies[19].pos = Vec3<float >(right, bottom, front);
-	vertecies[19].tPos = Vec2< float >(1.f, 0.f);
-	vertecies[20].pos = Vec3<float >(left, top, back);
-	vertecies[20].tPos = Vec2< float >(0.0f, 0.0f);
-	vertecies[21].pos = Vec3<float >(right, top, back);
-	vertecies[21].tPos = Vec2< float >(1.0f, 0.0f);
-	vertecies[22].pos = Vec3<float >(left, bottom, back);
-	vertecies[22].tPos = Vec2< float >(0.0f, 1.0f);
-	vertecies[23].pos = Vec3<float >(right, bottom, back);
-	vertecies[23].tPos = Vec2< float >(1.0f, 1.0f);
-
-	data->setVertecies(vertecies, 24);
-	// the order of the polygons has to be NORTH, EAST, SOUTH, WEST, TOP, BOTTOM according to the Area definition
-	// down side
-	Polygon3D* p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 6 + 16;
-	p->indexList[1] = 2 + 16;
-	p->indexList[2] = 3 + 16;
-	p->indexList[3] = 6 + 16;
-	p->indexList[4] = 3 + 16;
-	p->indexList[5] = 7 + 16;
-	data->addPolygon(p);
-	// right side
-	p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 1 + 8;
-	p->indexList[1] = 7 + 8;
-	p->indexList[2] = 3 + 8;
-	p->indexList[3] = 1 + 8;
-	p->indexList[4] = 5 + 8;
-	p->indexList[5] = 7 + 8;
-	data->addPolygon(p);
-	// top side
-	p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 4 + 16;
-	p->indexList[1] = 1 + 16;
-	p->indexList[2] = 0 + 16;
-	p->indexList[3] = 4 + 16;
-	p->indexList[4] = 5 + 16;
-	p->indexList[5] = 1 + 16;
-	data->addPolygon(p);
-	// left side
-	p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0 + 8;
-	p->indexList[1] = 2 + 8;
-	p->indexList[2] = 6 + 8;
-	p->indexList[3] = 0 + 8;
-	p->indexList[4] = 6 + 8;
-	p->indexList[5] = 4 + 8;
-	data->addPolygon(p);
-	// back side
-	p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 4;
-	p->indexList[1] = 6;
-	p->indexList[2] = 7;
-	p->indexList[3] = 4;
-	p->indexList[4] = 7;
-	p->indexList[5] = 5;
-	data->addPolygon(p);
-	// front side
-	p = new Polygon3D();
-	p->indexAnz = 6;
-	p->indexList = new int[p->indexAnz];
-	p->indexList[0] = 0;
-	p->indexList[1] = 3;
-	p->indexList[2] = 2;
-	p->indexList[3] = 0;
-	p->indexList[4] = 1;
-	p->indexList[5] = 3;
-	data->addPolygon(p);
-	data->calculateNormals();
-	data->release();
-}
-
-void createModels(Bildschirm* zScreen)
-{
-	createDefaultCube(zScreen);
-	createCubeItem(zScreen);
-	createPlayer(zScreen);
-}
-
-
-LoadMenu::LoadMenu(Bildschirm* zScreen)
-	: Menu(zScreen)
-{
-	Punkt center = zScreen->getBackBufferSize() / 2;
-	step = initFBalken(center.x - 100, center.y + 25, 200, 30, FBalken::Style::normal);
-	stage = initFBalken(center.x - 100, center.y - 15, 200, 30, FBalken::Style::normal);
-	all = initFBalken(center.x - 100, center.y - 55, 200, 30, FBalken::Style::normal);
-	elements.add(step);
-	elements.add(stage);
-	elements.add(all);
-
-	new AsynchronCall("Load Menu", [this, zScreen]()
-		{
-			Sleep(1000);
-			all->setAktionAnzahl(2);
-			all->reset();
-			// 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();
-				}
-				stage->setAktionAnzahl(count);
-				stage->reset();
-				for (Text* fileName : *files)
-				{
-					LTDBDatei dat;
-					dat.setDatei(new Text(Text("data/textures/") + *fileName));
-					dat.leseDaten(0);
-					for (Text* name : *dat.zBildListe())
-					{
-						step->reset();
-						Bild* b = dat.laden(step, new Text(*name));
-						zScreen->zGraphicsApi()->createOrGetTextur(*fileName + "/" + *name, b)->release();
-						stage->aktionPlus();
-					}
-				}
-				files->release();
-			}
-			all->aktionPlus();
-			// loading models
-			stage->setAktionAnzahl(1);
-			Datei modelF;
-			modelF.setDatei("data/models");
-			files = modelF.getDateiListe();
-			if (files)
-			{
-				int count = 0;
-				for (Text* fileName : *files)
-				{
-					M3Datei dat(Text("data/models/") + *fileName);
-					dat.leseDaten();
-					count += dat.getModelAnzahl();
-				}
-				stage->setAktionAnzahl(count + 1);
-				stage->reset();
-				for (Text* fileName : *files)
-				{
-					M3Datei dat(Text("data/models/") + *fileName);
-					dat.leseDaten();
-					for (int i = 0; i < dat.getModelAnzahl(); i++)
-					{
-						step->reset();
-						Model3DData* d = dat.ladeModel(dat.zModelName(i)->getText(), zScreen->zGraphicsApi(), *fileName + "/" + *dat.zModelName(i));
-						d->release();
-						stage->aktionPlus();
-					}
-				}
-				files->release();
-			}
-			createModels(zScreen);
-			stage->aktionPlus();
-			all->aktionPlus();
-			stage->reset();
-			zScreen->lock();
-			hide();
-			menuRegister->get("serverSelection")->show();
-			zScreen->unlock();
-		});
-}

+ 0 - 32
enc_temp_folder/3c2afc6a4b27a7caad432882b3711f1c/BlockType.cpp

@@ -1,32 +0,0 @@
-#include "BlockType.h"
-#include "Block.h"
-
-#include "Registries.h"
-
-using namespace Framework;
-
-BlockType::BlockType(int id, bool needsInstance, ModelInfo model, int initialMaxHP)
-	: ReferenceCounter(),
-	id(id),
-	needsInstance(needsInstance),
-	model(model),
-	initialMaxHP(initialMaxHP)
-{}
-
-BlockType::~BlockType()
-{}
-
-Block* BlockType::createBlock(Framework::Vec3<int> position)
-{
-	return new Block(this, position, model.getModel(), model.getTexture(), initialMaxHP);
-}
-
-int BlockType::getId() const
-{
-	return id;
-}
-
-bool BlockType::doesNeedInstance() const
-{
-	return needsInstance;
-}

+ 0 - 11
enc_temp_folder/417d9d558f3e8f5f14c5cf33fb5986a/DragElement.h

@@ -1,11 +0,0 @@
-#pragma once
-
-#include <Bild.h>
-
-
-class DragElement : public Framework::BildZ
-{
-public:
-	DragElement();
-	void doMausEreignis(Framework::MausEreignis& me, bool userRet) override;
-};

+ 0 - 45
enc_temp_folder/451246f3f099a7e663dcea31b22f288/ModelInfo.cpp

@@ -1,45 +0,0 @@
-#include <Textur.h>
-
-#include "ModelInfo.h"
-#include "Globals.h"
-
-using namespace Framework;
-
-ModelInfo::ModelInfo(Framework::StreamReader* reader)
-{
-	char len;
-	reader->lese(&len, 1);
-	char* path = new char[len + 1];
-	reader->lese(path, len);
-	path[len] = 0;
-	modelPath = path;
-	delete[] path;
-	short count;
-	reader->lese((char*)&count, 2);
-	for (int i = 0; i < count; i++)
-	{
-		reader->lese(&len, 1);
-		path = new char[len + 1];
-		reader->lese(path, len);
-		path[len] = 0;
-		texturPaths.add(new Text(path));
-		delete[] path;
-	}
-}
-
-Framework::Model3DData* ModelInfo::getModel() const
-{
-	return uiFactory.initParam.bildschirm->zGraphicsApi()->getModel(modelPath);
-}
-
-Framework::Model3DTextur* ModelInfo::getTexture() const
-{
-	Model3DTextur* textur = new Model3DTextur();
-	int index = 0;
-	for (Text* texturPath : texturPaths)
-	{
-		Textur* tex = uiFactory.initParam.bildschirm->zGraphicsApi()->createOrGetTextur(texturPath->getText(), 0);
-		textur->setPolygonTextur(index++, tex);
-	}
-	return textur;
-}

+ 0 - 18
enc_temp_folder/45ba55b34681a81f4c8590e163c81db8/CustomDX11API.h

@@ -1,18 +0,0 @@
-#pragma once
-
-#include <GraphicsApi.h>
-
-class CustomDX11API : public Framework::DirectX11
-{
-private:
-	int vertexShaderLightBufferIndex;
-
-protected:
-	Framework::DX11VertexShader* initializeVertexShader(unsigned char* byteCode, int size) override;
-	Framework::DX11PixelShader* initializePixelShader(unsigned char* byteCode, int size) override;
-
-public:
-	CustomDX11API();
-
-	int getVertexShaderLightBufferIndex() const;
-};

+ 0 - 21
enc_temp_folder/4876b17b4f30766328b89d442a16e79/EntityType.h

@@ -1,21 +0,0 @@
-#pragma once
-
-#include <ReferenceCounter.h>
-#include <Reader.h>
-#include <Vec3.h>
-
-#include "ModelInfo.h"
-
-class Entity;
-
-class EntityType : public virtual Framework::ReferenceCounter
-{
-private:
-	const int id;
-	ModelInfo model;
-
-public:
-	EntityType(int id, ModelInfo model);
-	Entity* loadEntity(Framework::StreamReader* zReader) const;
-	int getId() const;
-};

+ 0 - 22
enc_temp_folder/4cf3c1a3eadd27e1b61e410a2f7b5b3/Menu.cpp

@@ -1,22 +0,0 @@
-#include "Menu.h"
-#include <AsynchronCall.h>
-
-Menu::Menu(Bildschirm* zScreen)
-	: ReferenceCounter(),
-	zScreen(zScreen)
-{}
-
-void Menu::show()
-{
-	for (auto member : elements)
-		zScreen->addMember(dynamic_cast<Zeichnung*>(member->getThis()));
-}
-
-void Menu::hide()
-{
-	new AsynchronCall([this]()
-		{
-			for (auto member : elements)
-				zScreen->removeMember(dynamic_cast<Zeichnung*>(member->getThis()));
-		});
-}

+ 0 - 18
enc_temp_folder/4d1a72a6f5157678fdc872365e12c1b/AddEntityUpdate.cpp

@@ -1,18 +0,0 @@
-#include "AddEntityUpdate.h"
-#include "StaticRegistry.h"
-#include "Registries.h"
-#include "Globals.h"
-#include "Entity.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 - 165
enc_temp_folder/51501657c4a6cf4d357c29932b1dd6a/Initialisierung.cpp

@@ -1,165 +0,0 @@
-#include "Initialisierung.h"
-#include <ToolTip.h>
-#include <Bildschirm.h>
-#include <MausEreignis.h>
-#include <DateiSystem.h>
-#include <Fenster.h>
-#include <Fortschritt.h>
-#include <Liste.h>
-#include "Globals.h"
-
-Knopf* initKnopf(int x, int y, int br, int hö, __int64 style, char* titel)
-{
-	Knopf* ret = uiFactory.createKnopf(uiFactory.initParam);
-	ret->addStyle(style);
-	ret->setPosition(x, y);
-	ret->setSize(br, hö);
-	ret->setText(titel);
-	ret->setHintergrundFarbe(0xFF000000);
-	ret->setRahmenFarbe(0xFF2E6DA4);
-	ret->setSchriftFarbe(0xFFFFFFFF);
-	ret->setRahmenBreite(1);
-	ret->setAlphaFeldStrength(10);
-	ret->setAlphaFeldFarbe(0xFF337AB7);
-	return ret;
-}
-
-KontrollKnopf* initKontrollKnopf(int x, int y, int br, int hö, __int64 style, char* txt)
-{
-	KontrollKnopf* ret = uiFactory.createKontrollKnopf(uiFactory.initParam);
-	ret->addStyle(style);
-	ret->setText(txt);
-	ret->setSText(txt);
-	ret->setPosition(x, y);
-	ret->setSize(br, hö);
-	return ret;
-}
-
-Fenster* initFenster(int x, int y, int br, int hö, __int64 style, char* titel)
-{
-	Fenster* ret = uiFactory.createFenster(uiFactory.initParam);
-	ret->addStyle(style);
-	ret->setPosition(x, y);
-	ret->setSize(br, hö);
-	if (ret->hatStyle(Fenster::Style::Titel))
-	{
-		ret->setTitel(titel);
-	}
-	return ret;
-}
-
-TextFeld* initTextFeld(int x, int y, int br, int hö, __int64 style, char* txt)
-{
-	TextFeld* ret = uiFactory.createTextFeld(uiFactory.initParam);
-	ret->setStyle(style);
-	ret->setText(txt);
-	ret->setPosition(x, y);
-	ret->setSize(br, hö);
-	ret->setRahmenFarbe(0xFF6d6d6d);
-	ret->setHintergrundFarbe(0xFF000000);
-	ret->setAlphaFeldFarbe(0xFF3d3d3d);
-	ret->setAlphaFeldStrength(10);
-	return ret;
-}
-
-BildZ* initBildZ(int x, int y, int br, int hö, __int64 style, Bild* b)
-{
-	BildZ* ret = uiFactory.createBildZ(uiFactory.initParam);
-	ret->setStyle(style);
-	ret->setPosition(x, y);
-	ret->setSize(br, hö);
-	if (b)
-		ret->setBildZ(b);
-	return ret;
-}
-
-AuswahlBox* initAuswahlBox(int x, int y, int br, int hö, __int64 style, std::initializer_list< char* > values)
-{
-	AuswahlBox* ret = uiFactory.createAuswahlBox(uiFactory.initParam);
-	ret->addStyle(style);
-	ret->setPosition(x, y);
-	ret->setSize(br, hö);
-	for (auto i = values.begin(); i != values.end(); i++)
-		ret->addEintrag(*i);
-	return ret;
-}
-
-ObjTabelle* initObjTabelle(int x, int y, int br, int hö, __int64 style, std::initializer_list< OBJTabelleSpalteIni > spalten, int überschriftHöhe)
-{
-	ObjTabelle* ret = uiFactory.createObjTabelle(uiFactory.initParam);
-	ret->addStyle(style);
-	ret->setPosition(x, y);
-	ret->setSize(br, hö);
-	for (auto i = spalten.begin(); i != spalten.end(); i++)
-	{
-		ret->addSpalte(i->name);
-		ret->setSpaltenBreite(i->name, i->breite);
-		if ((style | ObjTabelle::Style::SpaltenBreiteMin) == style)
-			ret->setMinSpaltenBreite(i->name, i->minBreite);
-		if ((style | ObjTabelle::Style::SpaltenBreiteMax) == style)
-			ret->setMaxSpaltenBreite(i->name, i->maxBreite);
-		if (überschriftHöhe)
-		{
-			if (ret->getZeilenNummer("Überschrift") < 0)
-			{
-				ret->addZeile(0, "Überschrift");
-				ret->setZeilenHeight(0, 20);
-			}
-			ret->setZeichnungZ(i->name, "Überschrift", initTextFeld(0, 0, i->breite, 20, TextFeld::Style::Text | TextFeld::Style::Center, i->name));
-		}
-	}
-	return ret;
-}
-
-LDiag* initLinienDiagramm(int x, int y, int br, int hö, __int64 style, DiagDaten* data)
-{
-	LDiag* ret = uiFactory.createLDiag(uiFactory.initParam);
-	ret->addStyle(style);
-	ret->setPosition(x, y);
-	ret->setSize(br, hö);
-	if (data)
-		ret->setDiagDatenZ(data);
-	return ret;
-}
-
-AuswahlListe* initAuswahlListe(int x, int y, int br, int hö, __int64 style, std::initializer_list< char* > values)
-{
-	AuswahlListe* ret = uiFactory.createAuswahlListe(uiFactory.initParam);
-	ret->setPosition(x, y);
-	ret->setSize(br, hö);
-	ret->addStyle(style);
-	for (auto i = values.begin(); i != values.end(); i++)
-		ret->addEintrag(*i);
-	ret->update();
-	return ret;
-}
-
-ZeichnungHintergrund* initZeichnungHintergrund(int x, int y, int br, int hö, __int64 style, int farbe)
-{
-	ZeichnungHintergrund* ret = new ZeichnungHintergrund();
-	ret->setStyle(style);
-	ret->setHintergrundFarbe(farbe);
-	if (ret->hatStyle(ZeichnungHintergrund::Style::Rahmen))
-	{
-		ret->setRahmenBreite(1);
-		ret->setRahmenFarbe(0xFF00FF00);
-	}
-	ret->setPosition(x, y);
-	ret->setSize(br, hö);
-	return ret;
-}
-
-void initToolTip(Zeichnung* obj, const char* txt)
-{
-	obj->setToolTipText(txt, uiFactory.initParam.bildschirm, uiFactory.initParam.schrift);
-	obj->zToolTip()->addStyle(TextFeld::Style::Mehrzeilig);
-}
-
-FBalken* initFBalken(int x, int y, int br, int hö, __int64 style)
-{
-	FBalken* ret = uiFactory.createFBalken(uiFactory.initParam);
-	ret->addStyle(style);
-	ret->setPosition(x, y);
-	ret->setSize(br, hö);
-	return ret;
-}

+ 0 - 277
enc_temp_folder/52dda8697ab91ee9d2c9ac2061cdff7/Chunk.cpp

@@ -1,277 +0,0 @@
-#include "Chunk.h"
-#include "Constants.h"
-#include "Globals.h"
-
-#include "Registries.h"
-
-
-Chunk::Chunk(Framework::Punkt location)
-	: ReferenceCounter(),
-	location(location),
-	isLoading(0)
-{}
-
-Chunk::Chunk(Framework::Punkt location, Framework::StreamReader* zReader)
-	: Chunk(location)
-{
-	load(zReader);
-}
-
-Chunk::~Chunk()
-{
-	char msg = 1; // remove observer
-	World::INSTANCE->zClient()->chunkAPIRequest(location, &msg, 1);
-}
-
-void Chunk::api(char* message)
-{
-	switch (message[0])
-	{
-	case 0: // set block
-	{
-		int index = *(int*)(message + 1);
-		int id = *(int*)(message + 5);
-		Framework::Vec3<int> location((index / WORLD_HEIGHT) / CHUNK_SIZE, (index / WORLD_HEIGHT) % CHUNK_SIZE, index % WORLD_HEIGHT);
-		location.x += this->location.x - CHUNK_SIZE / 2;
-		location.y += this->location.y - CHUNK_SIZE / 2;
-		if (blockTypes[id]->doesNeedInstance())
-		{
-			Block* zB = blockTypes[id]->createBlock(location);
-			setBlock(zB);
-		}
-		else
-		{
-			Block* zB = zBlockAt(location);
-			if (zB)
-				removeBlock(zB);
-		}
-		break;
-	}
-	case 1: // update light
-	{
-		int index = *(int*)(message + 1);
-		Framework::Vec3<int> location((index / WORLD_HEIGHT) / CHUNK_SIZE, (index / WORLD_HEIGHT) % CHUNK_SIZE, index % WORLD_HEIGHT);
-		for (int i = 0; i < 6; i++)
-		{
-			Framework::Vec3<int> pos = location + getDirection(getDirectionFromIndex(i));
-			if (pos.z >= 0 && pos.z < WORLD_HEIGHT)
-			{
-				if (pos.x >= 0 && pos.x < CHUNK_SIZE && pos.y >= 0 && pos.y < CHUNK_SIZE)
-				{
-					pos.x += this->location.x - CHUNK_SIZE / 2;
-					pos.y += this->location.y - CHUNK_SIZE / 2;
-					Block* zB = zBlockAt(pos);
-					if (zB)
-					{
-						bool visible = zB->isVisible();
-						zB->setLightData(getOppositeDirection(getDirectionFromIndex(i)), (unsigned char*)(message + 5));
-						if (zB->isVisible() != visible)
-						{
-							vcs.lock();
-							if (zB->isVisible())
-								visibleBlocks.add(zB);
-							else
-							{
-								for (Framework::Iterator<Block*> iterator = visibleBlocks.begin(); iterator; iterator++)
-								{
-									if (zB == (Block*)iterator)
-									{
-										iterator.remove();
-										break;
-									}
-								}
-							}
-							vcs.unlock();
-						}
-					}
-				}
-				else
-				{
-					pos.x += this->location.x - CHUNK_SIZE / 2;
-					pos.y += this->location.y - CHUNK_SIZE / 2;
-					Block* zB = World::INSTANCE->zBlockAt(pos);
-					if (zB)
-					{
-						bool visible = zB->isVisible();
-						zB->setLightData(getOppositeDirection(getDirectionFromIndex(i)), (unsigned char*)(message + 5));
-						if (zB->isVisible() != visible)
-						{
-							Chunk* c = World::INSTANCE->zChunk(World::INSTANCE->getChunkCenter(pos.x, pos.y));
-							c->vcs.lock();
-							if (zB->isVisible())
-								c->visibleBlocks.add(zB);
-							else
-							{
-								for (Framework::Iterator<Block*> iterator = c->visibleBlocks.begin(); iterator; iterator++)
-								{
-									if (zB == (Block*)iterator)
-									{
-										iterator.remove();
-										break;
-									}
-								}
-							}
-							c->vcs.unlock();
-						}
-					}
-				}
-			}
-		}
-	}
-	}
-}
-
-Block* Chunk::zBlockAt(Framework::Vec3<int> location)
-{
-	cs.lock();
-	for (Block* b : blocks)
-	{
-		if (b->getLocation() == location)
-		{
-			cs.unlock();
-			return b;
-		}
-	}
-	cs.unlock();
-	return 0;
-}
-
-void Chunk::setBlock(Block* block)
-{
-	cs.lock();
-	Framework::Vec3<int> pos = block->getLocation();
-	for (Framework::Iterator<Block*> iterator = blocks.begin(); iterator; iterator++)
-	{
-		if (pos == iterator->getLocation())
-		{
-			vcs.lock();
-			for (Framework::Iterator<Block*> vi = visibleBlocks.begin(); vi; vi++)
-			{
-				if ((Block*)iterator == (Block*)vi)
-				{
-					iterator.remove();
-					break;
-				}
-			}
-			vcs.unlock();
-			iterator->release();
-			iterator.set(block);
-			break;
-		}
-	}
-	blocks.add(block);
-	cs.unlock();
-}
-
-void Chunk::removeBlock(Block* zBlock)
-{
-	cs.lock();
-	vcs.lock();
-	for (Framework::Iterator<Block*> iterator = visibleBlocks.begin(); iterator; iterator++)
-	{
-		if (zBlock == (Block*)iterator)
-		{
-			iterator.remove();
-			break;
-		}
-	}
-	vcs.unlock();
-	for (Framework::Iterator<Block*> iterator = blocks.begin(); iterator; iterator++)
-	{
-		if (zBlock == (Block*)iterator)
-		{
-			iterator.remove();
-			break;
-		}
-	}
-	cs.unlock();
-}
-
-void Chunk::load(Framework::StreamReader* zReader)
-{
-	isLoading = 1;
-	Framework::Vec3<int> pos = { 0, 0, 0 };
-	unsigned short id;
-	zReader->lese((char*)&id, 2);
-	while (id)
-	{
-		int index;
-		zReader->lese((char*)&index, 4);
-		pos = Vec3<int>((index / WORLD_HEIGHT) / CHUNK_SIZE, (index / WORLD_HEIGHT) % CHUNK_SIZE, index % WORLD_HEIGHT);
-		if (blockTypes[id]->doesNeedInstance())
-			setBlock(blockTypes[id]->createBlock({ pos.x + location.x - CHUNK_SIZE / 2, pos.y + location.y - CHUNK_SIZE / 2, pos.z }));
-		zReader->lese((char*)&id, 2);
-	}
-	int index = 0;
-	// light
-	zReader->lese((char*)&index, 4);
-	char lightData[6];
-	while (index >= 0)
-	{
-		zReader->lese(lightData, 6);
-		Framework::Vec3<int> location((index / WORLD_HEIGHT) / CHUNK_SIZE, (index / WORLD_HEIGHT) % CHUNK_SIZE, index % WORLD_HEIGHT);
-		for (int i = 0; i < 6; i++)
-		{
-			Framework::Vec3<int> pos = location + getDirection(getDirectionFromIndex(i));
-			if (pos.z >= 0 && pos.z < WORLD_HEIGHT)
-			{
-				if (pos.x >= 0 && pos.x < CHUNK_SIZE && pos.y >= 0 && pos.y < CHUNK_SIZE)
-				{
-					pos.x += this->location.x - CHUNK_SIZE / 2;
-					pos.y += this->location.y - CHUNK_SIZE / 2;
-					Block* zB = zBlockAt(pos);
-					if (zB)
-					{
-						bool visible = zB->isVisible();
-						zB->setLightData(getOppositeDirection(getDirectionFromIndex(i)), (unsigned char*)lightData);
-						if (zB->isVisible() && !visible)
-							visibleBlocks.add(zB);
-					}
-				}
-				else
-				{
-					pos.x += this->location.x - CHUNK_SIZE / 2;
-					pos.y += this->location.y - CHUNK_SIZE / 2;
-					Block* zB = World::INSTANCE->zBlockAt(pos);
-					if (zB)
-					{
-						bool visible = zB->isVisible();
-						zB->setLightData(getOppositeDirection(getDirectionFromIndex(i)), (unsigned char*)lightData);
-						if (zB->isVisible() && !visible)
-						{
-							Chunk* c = World::INSTANCE->zChunk(World::INSTANCE->getChunkCenter(pos.x, pos.y));
-							c->vcs.lock();
-							c->visibleBlocks.add(zB);
-							c->vcs.unlock();
-						}
-					}
-				}
-			}
-		}
-		zReader->lese((char*)&index, 4);
-	}
-	isLoading = 0;
-}
-
-Framework::Punkt Chunk::getCenter() const
-{
-	return location;
-}
-
-Framework::Vec3<int> Chunk::getMin() const
-{
-	return { location.x - CHUNK_SIZE / 2, location.y - CHUNK_SIZE / 2, 0 };
-}
-
-Framework::Vec3<int> Chunk::getMax() const
-{
-	return { location.x + CHUNK_SIZE / 2, location.y + CHUNK_SIZE / 2, WORLD_HEIGHT };
-}
-
-void Chunk::forAll(std::function<void(Model3D*)> f)
-{
-	vcs.lock();
-	for (Block* b : visibleBlocks)
-		f(b);
-	vcs.unlock();
-}

+ 0 - 27
enc_temp_folder/5795ce2e2f68bd624f1cc69f0f5c8da/BlockType.h

@@ -1,27 +0,0 @@
-#pragma once
-
-#include <Reader.h>
-#include <ReferenceCounter.h>
-#include <Vec3.h>
-
-#include "StaticRegistry.h"
-#include "ModelInfo.h"
-
-class Block;
-
-class BlockType : public virtual Framework::ReferenceCounter
-{
-private:
-	const int id;
-	bool needsInstance;
-	int initialMaxHP;
-	ModelInfo model;
-
-public:
-	BlockType(int id, bool needsInstance, ModelInfo model, int initialMaxHP);
-	~BlockType();
-	Block* createBlock(Framework::Vec3<int> position);
-	bool doesNeedInstance() const;
-
-	int getId() const;
-};

+ 0 - 16
enc_temp_folder/6bb73f40c164ba9b456ed65bee126b99/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 - 62
enc_temp_folder/6c14995eccfa6537b21468f668959267/DragController.h

@@ -1,62 +0,0 @@
-#pragma once
-
-#include <Zeichnung.h>
-#include "DragElement.h"
-
-template<typename Source, typename Element>
-class DragController : public Framework::ReferenceCounter
-{
-private:
-	Source* container;
-	Element currentElement;
-	DragElement* drag;
-	std::function<void()> onDragEnd;
-
-public:
-	DragController()
-		: ReferenceCounter()
-	{
-		container = 0;
-		currentElement = 0;
-		drag = new DragElement();
-	}
-
-	~DragController()
-	{
-		if (this->container)
-			stopDrag();
-		drag->release();
-	}
-
-	void beginDrag(Source* container, Element element, Framework::Bild* zDragDisplay, std::function<void()> onDragEnd)
-	{
-		if (this->container)
-			stopDrag();
-		((BildZ*)drag)->setBildZ(dynamic_cast<Bild*>(zDragDisplay->getThis()));
-		window->zBildschirm()->addMember(dynamic_cast<Zeichnung*>(drag->getThis()));
-		this->container = container;
-		this->currentElement = element;
-		this->onDragEnd = onDragEnd;
-	}
-
-	Source* getCurrentDragContainer() const
-	{
-		return container;
-	}
-
-	Element getCurrentDaragElement() const
-	{
-		return currentElement;
-	}
-
-	void stopDrag()
-	{
-		if (container)
-		{
-			window->zBildschirm()->removeMember(drag);
-			onDragEnd();
-			container = 0;
-			currentElement = 0;
-		}
-	}
-};

+ 0 - 14
enc_temp_folder/72156073275f6358c87cd3cf596fcc4/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 - 46
enc_temp_folder/731a4feda1e46a1d2df75b3f2592ee7/FactoryClient.h

@@ -1,46 +0,0 @@
-#pragma once
-
-#include <Network.h>
-#include <Klient.h>
-#include <Text.h>
-#include <Thread.h>
-#include <Critical.h>
-#include <VecN.h>
-#include <Either.h>
-#include <Punkt.h>
-
-#include "Entity.h"
-
-class FactoryClient : public Framework::ReferenceCounter
-{
-private:
-	Network::SSLKlient* client;
-	Network::Klient* foreground;
-	Network::Klient* background;
-	Network::NetworkReader* foregroundReader;
-	Network::NetworkReader* backgroundReader;
-	Framework::Critical cs;
-	Framework::Text ip;
-	int bgReaderUsage;
-	int fgReaderUsage;
-
-	void disconnect();
-	void loadServerInfo();
-
-public:
-	FactoryClient();
-	~FactoryClient();
-
-	bool connect(Framework::Text ip, unsigned short sslPort);
-	int ping();
-	int status(Framework::Text name, Framework::Text secret);
-	int join(Framework::Text name, Framework::Text &secret, unsigned short port);
-	Network::NetworkReader* getNextForegroundMessage();
-	Network::NetworkReader* getNextBackgroundMessage();
-	void endMessageReading(bool bg);
-	void sendPlayerAction(char* data, unsigned short length);
-	void sendPlayerMovement(MovementFrame& frame);
-	void entityAPIRequest(int entityId, char* message, unsigned short length);
-	void chunkAPIRequest(Framework::Punkt center, char* message, unsigned short length);
-	void inventoryAPIRequest(Framework::Either<int, Framework::VecN<int, 4>> target, char* message, unsigned short length);
-};

+ 0 - 31
enc_temp_folder/7a1b7c013656d33b6d1375faeb4bd9/Game.h

@@ -1,31 +0,0 @@
-#pragma once
-
-#include <Knopf.h>
-#include <Bild.h>
-
-#include "Menu.h"
-#include "Dialog.h"
-#include "DragController.h"
-
-class Player;
-class InventoryDragSource;
-
-class Game : public Menu
-{
-private:
-	Framework::Knopf* logout;
-	Framework::TextFeld* debug;
-	Framework::Array<UIMLDialog*> dialogs;
-	Framework::UIMLView* guiView;
-	DragController<InventoryDragSource, int>* inventoryDragController;
-
-public:
-	// Konstruktor
-	Game(Bildschirm* zScreen);
-	~Game();
-
-	void updatePosition(Vec3<float> position, bool target, Vec3<int> targetPos);
-	void api(char* data);
-	void closeCurrentDialog();
-	DragController<InventoryDragSource, int>* zInventoryDragController();
-};

+ 0 - 338
enc_temp_folder/8274a4e22fc21f2821b38041b42242/World.cpp

@@ -1,338 +0,0 @@
-#include <Network.h>
-#include <Welt3D.h>
-#include <GraphicsApi.h>
-#include <iostream>
-#include "World.h"
-#include "Globals.h"
-#include "WorldUpdate.h"
-#include "Constants.h"
-#include "Registries.h"
-#include "Game.h"
-#include <AsynchronCall.h>
-
-using namespace Network;
-using namespace Framework;
-
-World* World::INSTANCE = 0;
-
-World::World(Bildschirm3D* zScreen, FactoryClient* client)
-	: Thread(),
-	client(client)
-{
-	renderedWorld = new Welt3D();
-	renderedWorld->addDiffuseLight(DiffuseLight{ Vec3<float>(0.5f, 0.5f, -1.f), Vec3<float>(1.f, 1.f, 1.f) });
-	currentDimension = new Dimension();
-	zScreenPtr = zScreen;
-	kam = new PlayerKam(zScreen);
-	kam->setWelt(renderedWorld);
-	zScreen->addKamera(kam);
-	firstMessage = 1;
-	ownEntityId = -1;
-	currentTarget = 0;
-	start();
-}
-
-World::~World()
-{
-	zScreenPtr->removeKamera(kam);
-	currentDimension->release();
-	if (currentTarget)
-		currentTarget->release();
-	client->release();
-}
-
-void World::update(bool background)
-{
-	NetworkReader* serverMessageReader = 0;
-	unsigned char type = 0;
-	while (background ? serverMessageReader = client->getNextBackgroundMessage() : 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;
-			serverMessageReader->lese((char*)&length, 4);
-			char* data = new char[length];
-			serverMessageReader->lese(data, length);
-			switch (data[0])
-			{
-			case 1: // dimension message
-			{
-				currentDimension->api(data + 1);
-				break;
-			}
-			case 2: // gui message
-				((Game*)(Menu*)menuRegister->get("game"))->api(data + 1);
-				break;
-			case 3: // set target
-			{
-				switch (data[1])
-				{
-				case 0:
-					setTarget(0);
-					break;
-				case 1:
-					setTarget(zEntity(*(int*)(data + 2)));
-					break;
-				case 2:
-					setTarget(zBlockAt(Vec3<int>(*(int*)(data + 2), *(int*)(data + 6), *(int*)(data + 10))));
-					break;
-				}
-				break;
-			}
-			}
-			delete[] data;
-			// TODO: process messages
-		}
-		if (type == 4) // POSITION UPDATE
-		{
-			int old = ownEntityId;
-			serverMessageReader->lese((char*)&ownEntityId, 4);
-			kam->setEntityId(ownEntityId);
-			Entity* p = zEntity(ownEntityId);
-			if (p)
-				p->setPlayerControlled();
-			if (old != ownEntityId)
-				client->sendPlayerAction("\5", 1);
-		}
-		client->endMessageReading(background);
-	}
-	client->endMessageReading(background);
-	Entity* player = getCurrentPlayerEntity();
-	if (player)
-	{
-		renderedWorld->lock();
-		currentDimension->removeDistantChunks({ (int)player->getPos().x, (int)player->getPos().y });
-		Punkt currentChunk = getChunkCenter((int)player->getX(), (int)player->getY());
-		for (int x = 0; x <= CHUNK_VISIBILITY_RANGE; x++)
-		{
-			for (int y = 0; y <= CHUNK_VISIBILITY_RANGE; y++)
-			{
-				std::function<void(Punkt)> requestChunk = [this](Punkt center)
-				{
-					Chunk* zC = currentDimension->zChunk(center);
-					if (!zC)
-					{
-						char msg[1];
-						msg[0] = 0; // add observer and request chaunk data
-						Punkt pos = center;
-						subLock.lock();
-						bool found = 0;
-						for (Punkt p : subscriptions)
-						{
-							if (p == pos)
-							{
-								found = 1;
-								break;
-							}
-						}
-						if (!found)
-						{
-							client->chunkAPIRequest(pos, msg, 1);
-							subscriptions.add(pos);
-						}
-						subLock.unlock();
-					}
-				};
-				requestChunk(currentChunk + Punkt(x * CHUNK_SIZE, y * CHUNK_SIZE));
-				if (y > 0)
-					requestChunk(currentChunk + Punkt(x * CHUNK_SIZE, -y * CHUNK_SIZE));
-				if (x > 0)
-				{
-					requestChunk(currentChunk + Punkt(-x * CHUNK_SIZE, y * CHUNK_SIZE));
-					if (y > 0)
-						requestChunk(currentChunk + Punkt(-x * CHUNK_SIZE, -y * CHUNK_SIZE));
-				}
-			}
-		}
-		renderedWorld->unlock();
-	}
-}
-
-void World::setChunk(Chunk* chunk)
-{
-	zScreenPtr->lock();
-	renderedWorld->lock();
-	currentDimension->setChunk(chunk, chunk->getCenter());
-	renderedWorld->unlock();
-	zScreenPtr->unlock();
-}
-
-void World::thread()
-{
-	new AsynchronCall("World Update", [this]()
-		{
-			while (true)
-			{
-				zScreenPtr->lock();
-				if (World::INSTANCE != this)
-				{
-					zScreenPtr->unlock();
-					return;
-				}
-				zScreenPtr->unlock();
-				update(0);
-				Sleep(10);
-			}
-		});
-	while (true)
-	{
-		zScreenPtr->lock();
-		if (World::INSTANCE != this)
-		{
-			zScreenPtr->unlock();
-			return;
-		}
-		zScreenPtr->unlock();
-		update(1);
-		Sleep(10);
-	}
-}
-
-Block* World::zBlockAt(Framework::Vec3<int> location) const
-{
-	return currentDimension->zBlock(location);
-	return 0;
-}
-
-Block* World::getBlockAt(Framework::Vec3<int> location) const
-{
-	return currentDimension->getBlock(location);
-	return 0;
-}
-
-Dimension* World::zDimension() const
-{
-	return currentDimension;
-}
-
-void World::setVisibility(Chunk* zChunk, bool visible)
-{
-	renderedWorld->lock();
-	if (visible)
-		renderedWorld->addCollection(dynamic_cast<Framework::Model3DCollection*>(zChunk->getThis()));
-	else
-		renderedWorld->removeCollection(zChunk);
-	renderedWorld->unlock();
-}
-
-void World::setVisibility(Entity* zEntity, bool visible)
-{
-	renderedWorld->lock();
-	if (visible)
-		renderedWorld->addZeichnung(dynamic_cast<Framework::Model3D*>(zEntity->getThis()));
-	else
-		renderedWorld->removeZeichnung(zEntity);
-	renderedWorld->unlock();
-}
-
-Framework::Punkt World::getChunkCenter(int x, int y) const
-{
-	return Punkt(((x < 0 ? x + 1 : x) / CHUNK_SIZE) * CHUNK_SIZE + (x < 0 ? -CHUNK_SIZE : CHUNK_SIZE) / 2, ((y < 0 ? y + 1 : y) / CHUNK_SIZE) * CHUNK_SIZE + (y < 0 ? -CHUNK_SIZE : CHUNK_SIZE) / 2);
-}
-
-Entity* World::zEntity(int id) const
-{
-	Entity* e = currentDimension->zEntity(id);
-	if (e)
-		return e;
-	return 0;
-}
-
-Entity* World::getEntity(int id) const
-{
-	Entity* e = currentDimension->getEntity(id);
-	if (e)
-		return e;
-	return 0;
-}
-
-void World::removeEntity(int id)
-{
-	currentDimension->removeEntity(id);
-}
-
-PlayerKam* World::zKamera() const
-{
-	return kam;
-}
-
-int World::getCurrentPlayerId() const
-{
-	return ownEntityId;
-}
-
-Entity* World::getCurrentPlayerEntity() const
-{
-	return zEntity(ownEntityId);
-}
-
-void World::setTarget(Framework::Model3D* zTarget)
-{
-	if (zTarget != currentTarget)
-	{
-		targetLock.lock();
-		if (currentTarget)
-		{
-			currentTarget->setAmbientFactor(currentTarget->getAmbientFactor() - 0.2f);
-			currentTarget->release();
-			currentTarget = 0;
-		}
-		if (zTarget)
-		{
-			currentTarget = dynamic_cast<Framework::Model3D*>(zTarget->getThis());
-			if (currentTarget)
-				currentTarget->setAmbientFactor(currentTarget->getAmbientFactor() + 0.2f);
-		}
-		targetLock.unlock();
-	}
-}
-
-void World::lockWorld()
-{
-	renderedWorld->lock();
-}
-
-void World::unlockWorld()
-{
-	renderedWorld->unlock();
-}
-
-void World::onChunkAdded(Punkt pos)
-{
-	subLock.lock();
-	int index = 0;
-	for (Punkt p : subscriptions)
-	{
-		if (p == pos)
-		{
-			subscriptions.remove(index);
-			break;
-		}
-		index++;
-	}
-	subLock.unlock();
-}
-
-Framework::Model3D* World::getCurrentTarget() const
-{
-	while (targetLock.isLocked())
-		Sleep(1);
-	return currentTarget ? dynamic_cast<Framework::Model3D*>(currentTarget->getThis()) : 0;
-}
-
-Chunk* World::zChunk(Punkt center)
-{
-	return currentDimension->zChunk(center);
-}
-
-FactoryClient* World::zClient() const
-{
-	return client;
-}

+ 0 - 67
enc_temp_folder/8726edde9d5ce1ea4fea362660bb528e/Main.cpp

@@ -1,67 +0,0 @@
-#include <main.h>
-#include <Network.h>
-#include <HttpRequest.h>
-#include <JSON.h>
-#include <Fenster.h>
-#include <Bildschirm.h>
-#include <GraphicsApi.h>
-#include <RenderThread.h>
-#include <Datei.h>
-#include <Schrift.h>
-#include <DateiSystem.h>
-#include "Globals.h"
-#include "CustomDX11API.h"
-
-
-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());
-	window.setBildschirm(dynamic_cast<Bildschirm*>(screen.getThis()));
-	screen.setFillFarbe(0);
-
-	uiFactory = Framework::defaultUI(fontRegister->get("normal"), &screen);
-	initMenus();
-
-	RenderTh rTh;
-	rTh.setMaxFps(120);
-	rTh.setBildschirm(dynamic_cast<Bildschirm*>(screen.getThis()));
-
-	rTh.beginn();
-	StartNachrichtenSchleife();
-	rTh.beenden();
-	releaseVariables();
-	Network::Exit();
-	return 0;
-}

+ 0 - 154
enc_temp_folder/89933bbcaa9a07595a67688884dbd2/PlayerKam.cpp

@@ -1,154 +0,0 @@
-#include <Globals.h>
-#include "PlayerKam.h"
-#include "Globals.h"
-#include "Game.h"
-
-
-PlayerKam::PlayerKam(Framework::Bildschirm3D* zScreen)
-	: Kam3D()
-{
-	kameraControll = 0;
-	setBildschirmPosition(0, 0);
-	setBildschirmSize(zScreen->getBackBufferSize());
-	setStyle(Kam3D::Style::Tick | Kam3D::Style::Movable | Kam3D::Style::Rotatable);
-	setRotation({ (float)PI / 2.f, 0, 0 });
-	entityId = -1;
-}
-
-void PlayerKam::setDirection(Framework::Vec3<float> direction)
-{
-	if (direction.getLengthSq() > 0)
-	{
-		float rotZ = std::atan2(direction.y, direction.x) + (float)PI / 2;
-		setRotation({ getRotation().x, getRotation().y, rotZ });
-	}
-}
-
-void PlayerKam::doTastaturEreignis(Framework::TastaturEreignis& te)
-{
-	if (te.id == TE_Press)
-	{
-		if (te.taste[0] >= '0' && te.taste[0] <= '9')
-		{
-			char action[5];
-			action[0] = 3;
-			*(int*)(action + 1) = te.taste[0] - '1';
-			if (*(int*)(action + 1) < 0)
-				*(int*)(action + 1) = 9;
-			World::INSTANCE->zClient()->sendPlayerAction(action, 5);
-		}
-	}
-	if (te.id == TE_Release)
-	{
-		if (te.virtualKey == T_Esc)
-		{
-			bool oldControl = kameraControll;
-			kameraControll = 0;
-			setShowCursor(true);
-			if (!oldControl)
-				((Game*)(Menu*)menuRegister->get("game"))->closeCurrentDialog();
-		}
-		if (te.virtualKey == T_Tab)
-		{
-			char action = 4;
-			World::INSTANCE->zClient()->sendPlayerAction(&action, 1);
-		}
-	}
-}
-
-void PlayerKam::doMausEreignis(Framework::MausEreignis& me)
-{
-	if (me.verarbeitet)
-	{
-		kameraControll = 0;
-		setShowCursor(true);
-	}
-	else
-	{
-		if (!kameraControll)
-		{
-			if (me.id == ME_PLinks)
-				setControlEnabled(1);
-		}
-		else
-		{
-			if (kameraControll)
-			{
-				if (me.id == ME_PLinks)
-				{
-					char action[2] = { 1, 8 };
-					World::INSTANCE->zClient()->sendPlayerAction(action, 2);
-				}
-				if (me.id == ME_RLinks)
-				{
-					char action[2] = { 0, 8 };
-					World::INSTANCE->zClient()->sendPlayerAction(action, 2);
-				}
-				if (me.id == ME_PRechts)
-				{
-					char action[2] = { 1, 9 };
-					World::INSTANCE->zClient()->sendPlayerAction(action, 2);
-				}
-				if (me.id == ME_RRechts)
-				{
-					char action[2] = { 0, 9 };
-					World::INSTANCE->zClient()->sendPlayerAction(action, 2);
-				}
-			}
-
-		}
-		me.verarbeitet = 1;
-	}
-}
-
-bool PlayerKam::tick(double time)
-{
-	__int64 style = 0;
-	if (hatStyle(Style::Movable))
-		style |= Style::Movable;
-	if (hatStyle(Style::Rotatable))
-		style |= Style::Rotatable;
-	if (hatStyle(Style::Zoomable))
-		style |= Style::Zoomable;
-	removeStyle(Style::Movable | Style::Rotatable | Style::Zoomable);
-	bool result = Kam3D::tick(time);
-	addStyle(style);
-	if (kameraControll)
-	{
-		Punkt dir = window->getGröße() / 2 - (getMausPos() - window->getPosition());
-		setRotation({ min(max(getRotation().x - dir.y * (float)time * 0.2f, 0.1f), 2.5f), getRotation().y, getRotation().z - dir.x * (float)time * 0.2f });
-		if (getRotation().z > 2 * PI)
-			setRotation({ getRotation().x, getRotation().y, getRotation().z - 2.f * (float)PI });
-		if (getRotation().z < -2 * PI)
-			setRotation({ getRotation().x, getRotation().y, getRotation().z + 2.f * (float)PI });
-		SetCursorPos(window->getPosition().x + window->getKörperGröße().x / 2, window->getPosition().y + window->getKörperGröße().y / 2);
-		setShowCursor(false);
-		setMausPos(window->getPosition() + window->getGröße() / 2);
-	}
-	return result;
-}
-
-void PlayerKam::setEntityId(int id)
-{
-	entityId = id;
-}
-
-void PlayerKam::setControlEnabled(bool enabled)
-{
-	kameraControll = enabled;
-	setShowCursor(!kameraControll);
-	if (kameraControll)
-	{
-		SetCursorPos(window->getPosition().x + window->getKörperGröße().x / 2, window->getPosition().y + window->getKörperGröße().y / 2);
-	}
-}
-
-int PlayerKam::getEntityId() const
-{
-	return entityId;
-}
-
-Framework::Vec3<float> PlayerKam::getDirection() const
-{
-	return getWorldDirection(getScreenPos() + getScreenSize() / 2);
-}

+ 0 - 26
enc_temp_folder/934b78f6f6df2e34ddbc8435a7aae/UIMLToolTip.cpp

@@ -1,26 +0,0 @@
-#include "UIMLToolTip.h"
-#include "Globals.h"
-
-using namespace Framework;
-
-UIMLToolTip::UIMLToolTip()
-	: ToolTip(window->zBildschirm())
-{
-	view = new UIMLView("", uiFactory);
-	addMember(view);
-	view->setStyle(UIMLView::Style::Sichtbar);
-	addStyle(ZeichnungHintergrund::Style::Hintergrund | ZeichnungHintergrund::Style::HAlpha | ZeichnungHintergrund::Style::Rahmen | ZeichnungHintergrund::Style::Sichtbar);
-	setHintergrundFarbe(0xA0000000);
-	setRahmenFarbe(0xFFFFFFFF);
-	setRahmenBreite(1);
-}
-
-UIMLToolTip::~UIMLToolTip()
-{}
-
-void UIMLToolTip::setUIML(const char* uiml)
-{
-	view->setUIML(uiml);
-	view->layout();
-	view->setSize(view->calculateContentSize());
-}

+ 0 - 33
enc_temp_folder/973c14c36971b73cfeec68881d0683/Area.h

@@ -1,33 +0,0 @@
-#pragma once
-
-#include <Vec3.h>
-
-struct Area
-{
-	int startX;
-	int startY;
-	int endX;
-	int endY;
-	int dimensionId;
-};
-
-enum Direction
-{
-	NO_DIRECTION = 0,
-	NORTH = 1,
-	EAST = 2,
-	SOUTH = 4,
-	WEST = 8,
-	TOP = 16,
-	BOTTOM = 32,
-	INSIDE = 64
-};
-typedef int Directions;
-
-#define ANY_DIRECTION NORTH | EAST | SOUTH | WEST | TOP | BOTTOM
-
-Framework::Vec3<int> getDirection(Directions dir);
-int getDirectionIndex(Direction dir);
-Direction getOppositeDirection(Direction dir);
-Direction getDirectionFromIndex(int index);
-Directions getDirectionsFromVector(Framework::Vec3<float> dir);

+ 204 - 0
enc_temp_folder/9b638151c6d234a85fa47499df0b4ba/Game.cpp

@@ -0,0 +1,204 @@
+#include "Game.h"
+
+#include <AsynchronCall.h>
+#include <Bildschirm.h>
+
+#include "Globals.h"
+#include "Initialisierung.h"
+#include "ItemBar.h"
+
+Game::Game(Bildschirm* zScreen)
+    : Menu(zScreen)
+{
+    inventoryDragController = new DragController<InventoryDragSource, int>();
+    logout = initKnopf(10, 10, 200, 20, Knopf::Style::Normal, "Verlassen");
+    logout->setMausEreignis([this, zScreen](void* p, void* o, MausEreignis me) {
+        if (me.id == ME_RLinks)
+        {
+            logout->removeStyle(Knopf::Style::Erlaubt);
+            new AsynchronCall([this, zScreen]() {
+                // TODO
+                /*if (World::INSTANCE->zClient()->leaveGame())
+                {
+                    World::INSTANCE->release();
+                    World::INSTANCE = 0;
+                    zScreen->lock();
+                    hide();
+                    menuRegister->get("directConnect")->show();
+                    zScreen->unlock();
+                }*/
+                logout->addStyle(Knopf::Style::Erlaubt);
+            });
+        }
+        return 1;
+    });
+    elements.add(logout);
+    debug = initTextFeld(10,
+        40,
+        500,
+        250,
+        TextFeld::Style::Text | TextFeld::Style::Mehrzeilig,
+        "");
+    elements.add(debug);
+    guiView = new UIMLView("<v/>", uiFactory);
+    guiView->addKnownElement(new ItemBarElement());
+    guiView->setStyle(UIMLView::Style::Sichtbar);
+    guiView->setSize(window->zBildschirm()->getBackBufferSize());
+    elements.add(guiView);
+    targetUIMLView = new UIMLView("<v/>", uiFactory);
+    targetUIMLView->setStyle(UIMLView::Style::Hintergrund
+                             | UIMLView::Style::HAlpha);
+    targetUIMLView->setHintergrundFarbe(0xA0000000);
+    elements.add(targetUIMLView);
+}
+
+Game::~Game()
+{
+    inventoryDragController->release();
+}
+
+void Game::updatePosition(
+    Vec3<float> position, bool target, Vec3<int> targetPos)
+{
+    Text txt = "Position: (";
+    txt.setPrecision(2);
+    txt += position.x;
+    txt += ", ";
+    txt += position.y;
+    txt += ", ";
+    txt += position.z;
+    txt += ")";
+    if (target)
+    {
+        txt += "\nTarget: (";
+        txt += targetPos.x;
+        txt += ", ";
+        txt += targetPos.y;
+        txt += ", ";
+        txt += targetPos.z;
+        txt += ")\n";
+        Block* b = World::INSTANCE->zBlockAt(targetPos);
+        if (b)
+        {
+            txt += "TargetLight: \n";
+            txt += b->printLightInfo();
+        }
+    }
+    debug->setText(txt);
+}
+
+void Game::api(char* data)
+{
+    switch (data[0])
+    {
+    case 0: // open dialog
+        {
+            bool exists = 0;
+            short len = *(short*)(data + 1);
+            char* dialogName = new char[len + 1];
+            memcpy(dialogName, data + 3, len);
+            dialogName[len] = 0;
+            for (UIMLDialog* dialog : dialogs)
+            {
+                if (dialog->getName().istGleich(dialogName))
+                {
+                    exists = 1;
+                    break;
+                }
+            }
+            delete[] dialogName;
+            if (!exists)
+            {
+                int uimlLen = *(int*)(data + 3 + len);
+                char* uiml = new char[uimlLen + 1];
+                memcpy(uiml, data + 7 + len, uimlLen);
+                uiml[uimlLen] = 0;
+                UIMLDialog* dialog
+                    = new UIMLDialog(uiml, [this](UIMLDialog* dialog) {
+                          logout->postAction([this, dialog]() {
+                              int index = 0;
+                              for (UIMLDialog* d : dialogs)
+                              {
+                                  if (d == dialog)
+                                  {
+                                      dialogs.remove(index);
+                                      window->zBildschirm()->removeMember(d);
+                                      World::INSTANCE->zKamera()
+                                          ->setControlEnabled(
+                                              dialogs.getEintragAnzahl() == 0);
+                                      break;
+                                  }
+                                  index++;
+                              }
+                          });
+                      });
+                dialogs.add(dialog);
+                World::INSTANCE->zKamera()->setControlEnabled(0);
+                window->zBildschirm()->addMember(dialog);
+                delete[] uiml;
+            }
+            break;
+        }
+    case 1:
+        { // element message
+            for (UIMLDialog* dialog : dialogs)
+            {
+                dialog->api(data + 1);
+            }
+            short idLen = *(short*)(data + 1);
+            char* id = new char[idLen + 1];
+            memcpy(id, data + 3, idLen);
+            id[idLen] = 0;
+            NetworkAPIProcessor* processor = dynamic_cast<NetworkAPIProcessor*>(
+                guiView->zZeichnungById(id));
+            if (processor) processor->api(data + 3 + idLen);
+            delete[] id;
+            break;
+        }
+    case 2:
+        { // set gui
+            int uimlLen = *(int*)(data + 1);
+            char* uiml = new char[uimlLen + 1];
+            memcpy(uiml, data + 5, uimlLen);
+            uiml[uimlLen] = 0;
+            guiView->setUIML(uiml);
+            guiView->layout();
+            delete[] uiml;
+        }
+    }
+}
+
+void Game::closeCurrentDialog()
+{
+    if (dialogs.getEintragAnzahl() > 0)
+    {
+        UIMLDialog* d = dialogs.get(dialogs.getEintragAnzahl() - 1);
+        window->zBildschirm()->removeMember(d);
+        dialogs.remove(dialogs.getEintragAnzahl() - 1);
+        World::INSTANCE->zKamera()->setControlEnabled(
+            dialogs.getEintragAnzahl() == 0);
+    }
+}
+
+DragController<InventoryDragSource, int>* Game::zInventoryDragController()
+{
+    return inventoryDragController;
+}
+
+void Game::setTargetUIML(Framework::Text uiml)
+{
+    if (uiml.getLength())
+    {
+        targetUIMLView->setUIML(uiml);
+        targetUIMLView->layout();
+        targetUIMLView->setSize(targetUIMLView->calculateContentSize());
+        targetUIMLView->setPosition(
+            window->zBildschirm()->zGraphicsApi()->getBackBufferSize()
+            - targetUIMLView->getSize());
+        targetUIMLView->addStyle(UIMLView::Style::Sichtbar);
+    }
+    else
+    {
+        targetUIMLView->removeStyle(UIMLView::Style::Sichtbar);
+    }
+}

+ 0 - 37
enc_temp_folder/9fe4615ad7bd97e9947e71f0c09e7f2d/Chunk.h

@@ -1,37 +0,0 @@
-#pragma once
-
-#include <Punkt.h>
-#include <Model3DCollection.h>
-#include <Reader.h>
-#include <Model3D.h>
-#include <Array.h>
-#include <Critical.h>
-
-#include "Block.h"
-#include "Area.h"
-
-class Chunk : public Framework::Model3DCollection
-{
-private:
-	Framework::Punkt location;
-	// TODO: use native array for bedder performance?
-	Framework::RCArray<Block> blocks;
-	Framework::Array<Block*> visibleBlocks;
-	bool isLoading;
-	Framework::Critical cs;
-	Framework::Critical vcs;
-
-public:
-	Chunk(Framework::Punkt location);
-	Chunk(Framework::Punkt location, Framework::StreamReader* zReader);
-	~Chunk();
-	void api(char* message);
-	Block* zBlockAt(Framework::Vec3<int> cLocation);
-	void setBlock(Block* block);
-	void removeBlock(Block* zBlock);
-	void load(Framework::StreamReader* zReader);
-	Framework::Punkt getCenter() const;
-	Framework::Vec3<int> getMin() const;
-	Framework::Vec3<int> getMax() const;
-	void forAll(std::function<void(Model3D*)> f) override;
-};

+ 0 - 115
enc_temp_folder/a0fa8bd84ace35bac3eb2735544cd/AddServerMenu.cpp

@@ -1,115 +0,0 @@
-#include "AddServerMenu.h"
-#include "Initialisierung.h"
-#include "Globals.h"
-#include "ServerSelection.h"
-
-AddServerMenu::AddServerMenu(Bildschirm* zScreen)
-	: Menu(zScreen)
-{
-	Punkt center = zScreen->getBackBufferSize() / 2;
-	TextFeld* nameLabel = initTextFeld(center.x - 150, center.y - 50, 100, 20, TextFeld::Style::Text | TextFeld::Style::VCenter, "Name:");
-	elements.add(nameLabel);
-	name = initTextFeld(nameLabel->getPosition().x + nameLabel->getBreite(), nameLabel->getPosition().y, 200, 20, TextFeld::Style::TextFeld, "");
-	name->setTastaturEreignis([this](void* p, void* o, TastaturEreignis te)
-		{
-			if (te.id == TE_Release && te.virtualKey == T_Tab)
-			{
-				name->removeStyle(Zeichnung::Style::Fokus);
-				address->addStyle(Zeichnung::Style::Fokus);
-			}
-			return te.virtualKey != T_Tab;
-		});
-	elements.add(name);
-
-	TextFeld* addressLabel = initTextFeld(center.x - 150, center.y - 25, 100, 20, TextFeld::Style::Text | TextFeld::Style::VCenter, "Server Address:");
-	elements.add(addressLabel);
-	address = initTextFeld(addressLabel->getPosition().x + addressLabel->getBreite(), addressLabel->getPosition().y, 200, 20, TextFeld::Style::TextFeld, "");
-	address->setTastaturEreignis([this](void* p, void* o, TastaturEreignis te)
-		{
-			if (te.id == TE_Release && te.virtualKey == T_Tab)
-			{
-				address->removeStyle(Zeichnung::Style::Fokus);
-				sslPort->addStyle(Zeichnung::Style::Fokus);
-			}
-			return te.virtualKey != T_Tab;
-		});
-	elements.add(address);
-
-	TextFeld* sslPortLabel = initTextFeld(center.x - 150, center.y, 100, 20, TextFeld::Style::Text | TextFeld::Style::VCenter, "SSL Server Port:");
-	elements.add(sslPortLabel);
-	sslPort = initTextFeld(sslPortLabel->getPosition().x + sslPortLabel->getBreite(), sslPortLabel->getPosition().y, 200, 20, TextFeld::Style::TextFeld, "");
-	sslPort->setTastaturEreignis([this](void* p, void* o, TastaturEreignis te)
-		{
-			if (te.id == TE_Release && te.virtualKey == T_Tab)
-			{
-				sslPort->removeStyle(Zeichnung::Style::Fokus);
-				port->addStyle(Zeichnung::Style::Fokus);
-			}
-			return te.virtualKey != T_Tab && _nurNummernTE(p, o, te);
-		});
-	elements.add(sslPort);
-	TextFeld* portLabel = initTextFeld(center.x - 150, center.y + 25, 100, 20, TextFeld::Style::Text | TextFeld::Style::VCenter, "Server Port:");
-	elements.add(portLabel);
-	port = initTextFeld(portLabel->getPosition().x + portLabel->getBreite(), portLabel->getPosition().y, 200, 20, TextFeld::Style::TextFeld, "");
-	port->setTastaturEreignis(_nurNummernTE);
-	elements.add(port);
-
-	add = initKnopf(center.x + 50, center.y + 50, 100, 20, Knopf::Style::Normal, "Add");
-	add->setMausEreignis([this](void* p, void* o, MausEreignis me)
-		{
-			if (me.id == ME_RLinks)
-			{
-				if (name->zText()->getLength() && address->zText()->getLength() && port->zText()->getLength())
-				{
-					if (!((ServerSelectionMenu*)(Menu*)menuRegister->get("serverSelection"))->hasServer(name->zText()->getText()))
-					{
-						hide();
-						menuRegister->get("serverSelection")->show();
-						((ServerSelectionMenu*)(Menu*)menuRegister->get("serverSelection"))->addServer(name->zText()->getText(), address->zText()->getText(), (unsigned short)(int)*sslPort->zText(), (unsigned short)(int)*port->zText());
-						name->zText()->setText("");
-						address->zText()->setText("");
-						port->zText()->setText("");
-						sslPort->zText()->setText("");
-						name->setAlphaFeldFarbe(0xFF3d3d3d);
-						address->setAlphaFeldFarbe(0xFF3d3d3d);
-						port->setAlphaFeldFarbe(0xFF3d3d3d);
-						sslPort->setAlphaFeldFarbe(0xFF3d3d3d);
-					}
-					else
-						name->setAlphaFeldFarbe(0xFF3d0000);
-				}
-				else
-				{
-					if(!name->zText()->getLength())
-						name->setAlphaFeldFarbe(0xFF3d0000);
-					if (!address->zText()->getLength())
-						address->setAlphaFeldFarbe(0xFF3d0000);
-					if (!port->zText()->getLength())
-						port->setAlphaFeldFarbe(0xFF3d0000);
-					if (!sslPort->zText()->getLength())
-						sslPort->setAlphaFeldFarbe(0xFF3d0000);
-				}
-			}
-			return 1;
-		});
-	elements.add(add);
-
-	abort = initKnopf(center.x - 150, center.y + 50, 100, 20, Knopf::Style::Normal, "Abort");
-	abort->setMausEreignis([this](void* p, void* o, MausEreignis me)
-		{
-			if (me.id == ME_RLinks)
-			{
-				hide();
-				menuRegister->get("serverSelection")->show();
-				name->zText()->setText("");
-				address->zText()->setText("");
-				port->zText()->setText("");
-				name->setAlphaFeldFarbe(0xFF3d3d3d);
-				address->setAlphaFeldFarbe(0xFF3d3d3d);
-				port->setAlphaFeldFarbe(0xFF3d3d3d);
-				sslPort->setAlphaFeldFarbe(0xFF3d3d3d);
-			}
-			return 1;
-		});
-	elements.add(abort);
-}

+ 0 - 209
enc_temp_folder/a36e7559d0941b36cff6d7348813d2d2/Block.cpp

@@ -1,209 +0,0 @@
-#include <Textur.h>
-#include <Shader.h>
-
-#include "Block.h"
-#include "Globals.h"
-#include "CustomDX11API.h"
-
-
-Block::Block(const BlockType* zType, Framework::Vec3<int> pos, Model3DData* model, Model3DTextur* texture, int maxHP)
-	: Model3D(),
-	zType(zType),
-	location(pos),
-	maxHP((float)maxHP)
-{
-	transparent = 0;
-	hp = (float)maxHP;
-	memset(sideVisible, 0, 6);
-	Model3D::setPosition((Framework::Vec3<float>)pos + Framework::Vec3<float>{0.5f, 0.5f, 0.5f});
-	setModelDaten(model);
-	setModelTextur(texture);
-	breakTextur = uiFactory.initParam.bildschirm->zGraphicsApi()->createOrGetTextur("blocks.ltdb/crack.png", 0);
-	memset(lightData, 0, 6 * 6);
-}
-
-Block::~Block()
-{
-	breakTextur->release();
-}
-
-void Block::beforeRender(GraphicsApi* api, Shader* zVertexShader, Shader* zPixelShader)
-{
-	CustomDX11API* cApi = dynamic_cast<CustomDX11API*>(api);
-	if (cApi && model->getVertexAnzahl() == 24)
-	{
-		int count = 24;
-		zVertexShader->füllConstBuffer((char*)&count, cApi->getVertexShaderLightBufferIndex(), 4);
-		zVertexShader->füllConstBuffer(lightBuffer, cApi->getVertexShaderLightBufferIndex() + 1, 24 * 4);
-	}
-	else
-	{
-		int count = 0;
-		zVertexShader->füllConstBuffer((char*)&count, cApi->getVertexShaderLightBufferIndex(), 4);
-	}
-}
-
-void Block::afterRender(GraphicsApi* api, Shader* zVertexShader, Shader* zPixelShader)
-{
-	CustomDX11API* cApi = dynamic_cast<CustomDX11API*>(api);
-	if (cApi && model->getVertexAnzahl() == 24)
-	{
-		int count = 0;
-		zVertexShader->füllConstBuffer((char*)&count, cApi->getVertexShaderLightBufferIndex(), 4);
-	}
-}
-
-void Block::api(char* message)
-{
-	// TODO: implement api
-	switch (message[0])
-	{
-	case 0: // hp change
-		hp = *(float*)(message + 1);
-		break;
-	}
-}
-
-bool Block::isTransparent() const
-{
-	return transparent;
-}
-
-void Block::setLightData(Direction dir, unsigned char* data)
-{
-	memcpy(lightData + getDirectionIndex(dir) * 6, data, 6);
-	if (model->getVertexAnzahl() == 24)
-	{
-		float dayLightFactor = 1.0; // TODO: day (1.f) - night (0.1f) adjustment
-		const Vertex3D* verticies = model->zVertexBuffer();
-		for (int i = 0; i < 24; i++)
-		{ // TODO: calculate rotations
-			Directions dirs = getDirectionsFromVector(verticies[i].pos);
-			Vec3<unsigned char> light(0, 0, 0);
-			for (int d = 0; d < 6; d++)
-			{
-				if ((dirs | getDirectionFromIndex(d)) == dirs)
-				{
-					light = Vec3<unsigned char>(max((unsigned char)((float)lightData[d * 6] * dayLightFactor), light.x), max((unsigned char)((float)lightData[d * 6 + 1] * dayLightFactor), light.y), max((unsigned char)((float)lightData[d * 6 + 2] * dayLightFactor), light.z));
-					light = Vec3<float>(max(lightData[d * 6 + 3], light.x), max(lightData[d * 6 + 4], light.y), max(lightData[d * 6 + 5], light.z));
-				}
-			}
-			int l = ((((light.x << 8) | light.y) << 8) | light.z) << 8;
-			*(int*)(lightBuffer + i * 4) = l;
-		}
-	}
-	if (data[0] | data[1] | data[2] | data[3] | data[4] | data[5])
-		sideVisible[getDirectionIndex(dir)] = 1;
-	else
-		sideVisible[getDirectionIndex(dir)] = 0;
-}
-
-bool Block::isVisible() const
-{
-	return sideVisible[0] || sideVisible[1] || sideVisible[2] || sideVisible[3] || sideVisible[4] || sideVisible[5];
-}
-
-Vec3<int> Block::getLocation() const
-{
-	return location;
-}
-
-const BlockType* Block::zBlockType() const
-{
-	return zType;
-}
-
-Textur* Block::zEffectTextur()
-{
-	if (hp < maxHP)
-		return breakTextur;
-	return 0;
-}
-
-float Block::getEffectPercentage()
-{
-	return 1 - hp / maxHP;
-}
-
-Text Block::printLightInfo()
-{
-	Text result = "NORTH[0;-1;0](";
-	result += (int)lightData[0];
-	result += ",";
-	result += (int)lightData[1];
-	result += ",";
-	result += (int)lightData[2];
-	result += ";";
-	result += (int)lightData[3];
-	result += ",";
-	result += (int)lightData[4];
-	result += ",";
-	result += (int)lightData[5];
-	result += ")\n";
-	result += "EAST[1;0;0](";
-	result += (int)lightData[6];
-	result += ",";
-	result += (int)lightData[7];
-	result += ",";
-	result += (int)lightData[8];
-	result += ";";
-	result += (int)lightData[9];
-	result += ",";
-	result += (int)lightData[10];
-	result += ",";
-	result += (int)lightData[11];
-	result += ")\n";
-	result += "SOUTH[0;1;0](";
-	result += (int)lightData[12];
-	result += ",";
-	result += (int)lightData[13];
-	result += ",";
-	result += (int)lightData[14];
-	result += ";";
-	result += (int)lightData[15];
-	result += ",";
-	result += (int)lightData[16];
-	result += ",";
-	result += (int)lightData[17];
-	result += ")\n";
-	result += "WEST[-1;0;0](";
-	result += (int)lightData[18];
-	result += ",";
-	result += (int)lightData[19];
-	result += ",";
-	result += (int)lightData[20];
-	result += ";";
-	result += (int)lightData[21];
-	result += ",";
-	result += (int)lightData[22];
-	result += ",";
-	result += (int)lightData[23];
-	result += ")\n";
-	result += "TOP[0;0;1](";
-	result += (int)lightData[24];
-	result += ",";
-	result += (int)lightData[25];
-	result += ",";
-	result += (int)lightData[26];
-	result += ";";
-	result += (int)lightData[27];
-	result += ",";
-	result += (int)lightData[28];
-	result += ",";
-	result += (int)lightData[29];
-	result += ")\n";
-	result += "BOTTOM[0;0;-1](";
-	result += (int)lightData[30];
-	result += ",";
-	result += (int)lightData[31];
-	result += ",";
-	result += (int)lightData[32];
-	result += ";";
-	result += (int)lightData[33];
-	result += ",";
-	result += (int)lightData[34];
-	result += ",";
-	result += (int)lightData[35];
-	result += ")\n";
-	return result;
-}

+ 0 - 63
enc_temp_folder/a64d52bdd16464cbf99c34b69d888f2/InventoryView.h

@@ -1,63 +0,0 @@
-#pragma once
-
-#include <UIMLView.h>
-#include <Either.h>
-#include <VecN.h>
-
-#include "NetworkAPIProcessor.h"
-
-class InventoryElement : public Framework::UIMLElement
-{
-public:
-	InventoryElement();
-	//! prüft, ob dieses UIML Element für ein bestimmtes xml Element zuständig ist
-	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;
-	//! wendet die layout parameter zu einer Zeichnung an
-	void layout(Framework::XML::Element& element, Framework::Zeichnung& z, int pWidth, int pHeight, Framework::UIMLContainer& generalLayouter) override;
-};
-
-struct SlotInfo
-{
-	int id;
-	int itemCount;
-	float hp;
-	float maxHp;
-	float durability;
-	float maxDurability;
-	Framework::Bild* zItem;
-
-	void render(int x, int y, Framework::Bild& rObj, bool selected, bool lightBackground);
-};
-
-class InventoryDragSource
-{
-public:
-	virtual Framework::Either<int, Framework::VecN<int, 4>> getInventoryTarget() const = 0;
-};
-
-class InventoryView : public Framework::ZeichnungHintergrund, public NetworkAPIProcessor, public InventoryDragSource
-{
-private:
-	int rowSize;
-	// entity id or block position
-	Framework::Either<int, Framework::VecN<int, 4>> target;
-	Framework::Text slotNameFilter;
-	Framework::Text id;
-	Framework::Array<SlotInfo>* slots;
-	int dragStartId;
-	int dragStopId;
-	int currentTooltipSlot;
-	int requestetTooltipSlot;
-	int getSlotByLocalPos(Framework::Punkt pos);
-
-public:
-	InventoryView(Framework::Text id, Framework::Either<int, Framework::VecN<int, 4>> target, int rowSize, Framework::Text slotNameFilter);
-	~InventoryView();
-	void api(char* message) override;
-	bool tick(double tickVal) override;
-	void render(Framework::Bild& rObj) override;
-	void doMausEreignis(Framework::MausEreignis& me, bool userRet) override;
-	Framework::Either<int, Framework::VecN<int, 4>> getInventoryTarget() const override;
-};

+ 0 - 23
enc_temp_folder/a860cdbf2c962163648b92d4fae0758f/PlayerKam.h

@@ -1,23 +0,0 @@
-#pragma once
-#include <Kam3D.h>
-#include <TastaturEreignis.h>
-#include <Bildschirm.h>
-#include <Zeit.h>
-
-class PlayerKam : public Framework::Kam3D
-{
-private:
-	bool kameraControll;
-	int entityId;
-
-public:
-	PlayerKam(Framework::Bildschirm3D* zScreen);
-	void setDirection(Framework::Vec3<float> direction);
-	void doTastaturEreignis(Framework::TastaturEreignis& te) override;
-	void doMausEreignis(Framework::MausEreignis& me) override;
-	bool tick(double time) override;
-	void setEntityId(int id);
-	void setControlEnabled(bool enabled);
-	int getEntityId() const;
-	Framework::Vec3<float> getDirection() const;
-};

+ 0 - 79
enc_temp_folder/aedf935c6dd4db16dd4e3a49daa122/Area.cpp

@@ -1,79 +0,0 @@
-#include "Area.h"
-
-
-Framework::Vec3<int> getDirection(Directions dir)
-{
-	Framework::Vec3<int> result(0, 0, 0);
-	if ((dir | NORTH) == dir)
-		--result.y;
-	if ((dir | EAST) == dir)
-		++result.x;
-	if ((dir | SOUTH) == dir)
-		++result.y;
-	if ((dir | WEST) == dir)
-		--result.x;
-	if ((dir | TOP) == dir)
-		++result.z;
-	if ((dir | BOTTOM) == dir)
-		--result.z;
-	return result;
-}
-
-int getDirectionIndex(Direction dir)
-{
-	if (dir == NORTH)
-		return 0;
-	if (dir == EAST)
-		return 1;
-	if (dir == SOUTH)
-		return 2;
-	if (dir == WEST)
-		return 3;
-	if (dir == TOP)
-		return 4;
-	if (dir == BOTTOM)
-		return 5;
-	assert(false);
-	return -1;
-}
-
-Direction getOppositeDirection(Direction dir)
-{
-	if (dir == NORTH)
-		return SOUTH;
-	if (dir == EAST)
-		return WEST;
-	if (dir == SOUTH)
-		return NORTH;
-	if (dir == WEST)
-		return EAST;
-	if (dir == TOP)
-		return BOTTOM;
-	if (dir == BOTTOM)
-		return TOP;
-	assert(false);
-	return NO_DIRECTION;
-}
-
-Direction getDirectionFromIndex(int index)
-{
-	return (Direction)(1 << index);
-}
-
-Directions getDirectionsFromVector(Framework::Vec3<float> dir)
-{
-	Directions dirs = NO_DIRECTION;
-	if (dir.y < 0)
-		dirs |= NORTH;
-	else if (dir.y > 0)
-		dirs |= SOUTH;
-	if (dir.x < 0)
-		dirs |= WEST;
-	else if (dir.x > 0)
-		dirs |= EAST;
-	if (dir.z < 0)
-		dirs |= BOTTOM;
-	else if (dir.z > 0)
-		dirs |= TOP;
-	return dirs;
-}

+ 0 - 53
enc_temp_folder/b37db95da51546ad7e8cc1c82cf42/Equipment.cpp

@@ -1,53 +0,0 @@
-#include <XML.h>
-
-#include "Equipment.h"
-
-using namespace Framework;
-
-EquipmentElement::EquipmentElement()
-	: UIMLElement()
-{}
-
-//! prüft, ob dieses UIML Element für ein bestimmtes xml Element zuständig ist
-bool EquipmentElement::isApplicableFor(Framework::XML::Element& element)
-{
-	return element.getName().istGleich("equipment");
-}
-
-//! erstellt eine neue Zeichnung zu einem gegebenen xml Element
-Framework::Zeichnung* EquipmentElement::parseElement(Framework::XML::Element& element, Framework::UIMLContainer& generalFactory)
-{
-	return new EquipmentView((int)element.getAttributeValue("entity"));
-}
-
-//! wendet die layout parameter zu einer Zeichnung an
-void EquipmentElement::layout(Framework::XML::Element& element, Framework::Zeichnung& z, int pWidth, int pHeight, Framework::UIMLContainer& generalLayouter)
-{
-	UIMLElement::layout(element, z, pWidth, pHeight, generalLayouter);
-}
-
-
-EquipmentView::EquipmentView(int entityId)
-	: ZeichnungHintergrund(),
-	entityId(entityId)
-{}
-
-void EquipmentView::api(char* message)
-{
-
-}
-
-bool EquipmentView::tick(double tickVal)
-{
-	return ZeichnungHintergrund::tick(tickVal);
-}
-
-void EquipmentView::render(Bild& rObj)
-{
-	ZeichnungHintergrund::render(rObj);
-}
-
-void EquipmentView::doMausEreignis(MausEreignis& me, bool userRet)
-{
-	ZeichnungHintergrund::doMausEreignis(me, userRet);
-}

+ 0 - 14
enc_temp_folder/b84b4e808b53ee53a977af8adca3bed/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 - 174
enc_temp_folder/ba411bc21d64e1d04caa78589c762/Game.cpp

@@ -1,174 +0,0 @@
-#include "Game.h"
-#include "Initialisierung.h"
-#include "Globals.h"
-#include "ItemBar.h"
-
-#include <AsynchronCall.h>
-#include <Bildschirm.h>
-
-Game::Game(Bildschirm* zScreen)
-	: Menu(zScreen)
-{
-	inventoryDragController = new DragController<InventoryDragSource, int>();
-	logout = initKnopf(10, 10, 200, 20, Knopf::Style::Normal, "Verlassen");
-	logout->setMausEreignis([this, zScreen](void* p, void* o, MausEreignis me)
-		{
-			if (me.id == ME_RLinks)
-			{
-				logout->removeStyle(Knopf::Style::Erlaubt);
-				new AsynchronCall([this, zScreen]()
-					{
-						// TODO
-						/*if (World::INSTANCE->zClient()->leaveGame())
-						{
-							World::INSTANCE->release();
-							World::INSTANCE = 0;
-							zScreen->lock();
-							hide();
-							menuRegister->get("directConnect")->show();
-							zScreen->unlock();
-						}*/ 
-						logout->addStyle(Knopf::Style::Erlaubt);
-					});
-			}
-			return 1;
-		});
-	elements.add(logout);
-	debug = initTextFeld(10, 40, 500, 250, TextFeld::Style::Text | TextFeld::Style::Mehrzeilig, "");
-	elements.add(debug);
-	guiView = new UIMLView("<v/>", uiFactory);
-	guiView->addKnownElement(new ItemBarElement());
-	guiView->setStyle(UIMLView::Style::Sichtbar);
-	guiView->setSize(window->zBildschirm()->getBackBufferSize());
-	elements.add(guiView);
-}
-
-Game::~Game()
-{
-	inventoryDragController->release();
-}
-
-void Game::updatePosition(Vec3<float> position, bool target, Vec3<int> targetPos)
-{
-	Text txt = "Position: (";
-	txt.setPrecision(2);
-	txt += position.x;
-	txt += ", ";
-	txt += position.y;
-	txt += ", ";
-	txt += position.z;
-	txt += ")";
-	if (target)
-	{
-		txt += "\nTarget: (";
-		txt += targetPos.x;
-		txt += ", ";
-		txt += targetPos.y;
-		txt += ", ";
-		txt += targetPos.z;
-		txt += ")\n";
-		Block* b = World::INSTANCE->zBlockAt(targetPos);
-		if (b)
-		{
-			txt += "TargetLight: \n";
-			txt += b->printLightInfo();
-		}
-	}
-	debug->setText(txt);
-}
-
-void Game::api(char* data)
-{
-	switch (data[0])
-	{
-	case 0: // open dialog
-	{
-		bool exists = 0;
-		short len = *(short*)(data + 1);
-		char* dialogName = new char[len + 1];
-		memcpy(dialogName, data + 3, len);
-		dialogName[len] = 0;
-		for (UIMLDialog* dialog : dialogs)
-		{
-			if (dialog->getName().istGleich(dialogName))
-			{
-				exists = 1;
-				break;
-			}
-		}
-		delete[] dialogName;
-		if (!exists)
-		{
-			int uimlLen = *(int*)(data + 3 + len);
-			char* uiml = new char[uimlLen + 1];
-			memcpy(uiml, data + 7 + len, uimlLen);
-			uiml[uimlLen] = 0;
-			UIMLDialog* dialog = new UIMLDialog(uiml, [this](UIMLDialog* dialog)
-				{
-					logout->postAction([this, dialog]()
-						{
-							int index = 0;
-							for (UIMLDialog* d : dialogs)
-							{
-								if (d == dialog)
-								{
-									dialogs.remove(index);
-									window->zBildschirm()->removeMember(d);
-									World::INSTANCE->zKamera()->setControlEnabled(dialogs.getEintragAnzahl() == 0);
-									break;
-								}
-								index++;
-							}
-						});
-				});
-			dialogs.add(dialog);
-			World::INSTANCE->zKamera()->setControlEnabled(0);
-			window->zBildschirm()->addMember(dialog);
-			delete[]uiml;
-		}
-		break;
-	}
-	case 1:
-	{ // element message
-		for (UIMLDialog* dialog : dialogs)
-		{
-			dialog->api(data + 1);
-		}
-		short idLen = *(short*)(data + 1);
-		char* id = new char[idLen + 1];
-		memcpy(id, data + 3, idLen);
-		id[idLen] = 0;
-		NetworkAPIProcessor* processor = dynamic_cast<NetworkAPIProcessor*>(guiView->zZeichnungById(id));
-		if (processor)
-			processor->api(data + 3 + idLen);
-		delete[] id;
-		break;
-	}
-	case 2:
-	{ // set gui
-		int uimlLen = *(int*)(data + 1);
-		char* uiml = new char[uimlLen + 1];
-		memcpy(uiml, data + 5, uimlLen);
-		uiml[uimlLen] = 0;
-		guiView->setUIML(uiml);
-		guiView->layout();
-		delete[] uiml;
-	}
-	}
-}
-
-void Game::closeCurrentDialog()
-{
-	if (dialogs.getEintragAnzahl() > 0)
-	{
-		UIMLDialog* d = dialogs.get(dialogs.getEintragAnzahl() - 1);
-		window->zBildschirm()->removeMember(d);
-		dialogs.remove(dialogs.getEintragAnzahl() - 1);
-		World::INSTANCE->zKamera()->setControlEnabled(dialogs.getEintragAnzahl() == 0);
-	}
-}
-
-DragController<InventoryDragSource, int>* Game::zInventoryDragController()
-{
-	return inventoryDragController;
-}

+ 0 - 6
enc_temp_folder/c5f2270d6bed8d7cbc360ea8541de2b/Constants.h

@@ -1,6 +0,0 @@
-#pragma once
-
-#define CHUNK_SIZE 16
-#define WORLD_HEIGHT 500
-#define CHUNK_VISIBILITY_RANGE 1
-#define MAX_VIEW_DISTANCE CHUNK_SIZE * CHUNK_VISIBILITY_RANGE

+ 0 - 39
enc_temp_folder/c8104cfdb4649a34402666be87bd5661/Dimension.h

@@ -1,39 +0,0 @@
-#pragma once
-
-#include <Array.h>
-#include <Trie.h>
-#include <Critical.h>
-
-#include "Chunk.h"
-#include "Entity.h"
-
-class World;
-
-class Dimension : public virtual Framework::ReferenceCounter
-{
-private:
-	Framework::Trie<Chunk>* chunks;
-	Framework::Array<Chunk*> chunkList;
-	Framework::RCArray<Entity>* entities;
-	Framework::Critical cs;
-	void getAddrOf(Framework::Punkt cPos, char* addr) const;
-	void getAddrOfWorld(Framework::Punkt wPos, char* addr) const;
-
-public:
-	Dimension();
-	~Dimension();
-
-	void api(char* message);
-	Block* zBlock(Framework::Vec3<int> location);
-	Block* getBlock(Framework::Vec3<int> location);
-	void addEntity(Entity* entity);
-	void setChunk(Chunk* chunk, Framework::Punkt center);
-	bool hasChunck(int x, int y) const;
-	Chunk* zChunk(Framework::Punkt wPos) const;
-	void removeDistantChunks(Framework::Punkt wPos);
-	void setBlock(Block* block);
-	void removeBlock(Block* zBlock);
-	Entity* zEntity(int id);
-	Entity* getEntity(int id);
-	void removeEntity(int id);
-};

+ 0 - 35
enc_temp_folder/c9cbefe684b7ad84345e9ec04d905b/CustomDX11API.cpp

@@ -1,35 +0,0 @@
-#include <Shader.h> 
-
-#include "CustomDX11API.h"
-
-#include "CustomUIDX11PixelShader.h"
-#include "CustomUIDX11VertexShader.h"
-
-using namespace Framework;
-
-CustomDX11API::CustomDX11API()
-	: DirectX11(),
-	vertexShaderLightBufferIndex(-1)
-{}
-
-Framework::DX11VertexShader* CustomDX11API::initializeVertexShader(unsigned char* byteCode, int size)
-{
-	DX11VertexShader* shader = DirectX11::initializeVertexShader((unsigned char*)CustomUIDX11VertexShader, sizeof(CustomUIDX11VertexShader));
-	vertexShaderLightBufferIndex = shader->getFirstUninitializedBufferIndex();
-	shader->erstelleConstBuffer(4, vertexShaderLightBufferIndex);
-	shader->erstelleConstBuffer(4 * 24, vertexShaderLightBufferIndex + 1);
-	int count = 0;
-	shader->füllConstBuffer((char*)&count, vertexShaderLightBufferIndex, 4);
-	return shader;
-}
-
-Framework::DX11PixelShader* CustomDX11API::initializePixelShader(unsigned char* byteCode, int size)
-{
-	DX11PixelShader* shader = DirectX11::initializePixelShader((unsigned char*)CustomUIDX11PixelShader, sizeof(CustomUIDX11PixelShader));
-	return shader;
-}
-
-int CustomDX11API::getVertexShaderLightBufferIndex() const
-{
-	return vertexShaderLightBufferIndex;
-}

+ 0 - 19
enc_temp_folder/d2cfdfdd6c2c64205fc6875e214b27b/Menu.h

@@ -1,19 +0,0 @@
-#pragma once
-#include <Array.h>
-#include <Zeichnung.h>
-#include <Bildschirm.h>
-
-using namespace Framework;
-
-class Menu : public ReferenceCounter
-{
-protected:
-	RCArray<Zeichnung> elements;
-	Bildschirm* zScreen;
-
-public:
-	Menu(Bildschirm* zScreen);
-
-	void show();
-	void hide();
-};

+ 0 - 19
enc_temp_folder/d46158fac4ce94c9b95a6c8415891c65/WorldUpdate.h

@@ -1,19 +0,0 @@
-#pragma once
-
-#include <ReferenceCounter.h>
-#include <Reader.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);
-};

+ 0 - 20
enc_temp_folder/d4e616c36a8b1e2a2abad0acef14d75e/Dialog.h

@@ -1,20 +0,0 @@
-#pragma once
-
-#include "NetworkAPIProcessor.h"
-
-#include <Fenster.h>
-#include <UIMLView.h>
-
-class UIMLDialog : public Framework::Fenster, public NetworkAPIProcessor
-{
-private:
-	Framework::UIMLView* view;
-	Framework::Text name;
-	std::function<void(UIMLDialog* self)> onClose;
-
-public:
-	UIMLDialog(Framework::Text uiml, std::function<void(UIMLDialog* self)> onClose);
-	~UIMLDialog();
-	void api(char* message) override;
-	const Framework::Text& getName() const;
-};

+ 0 - 49
enc_temp_folder/d96dc9ecf990a09e6658711cb19a4160/CraftingGrid.h

@@ -1,49 +0,0 @@
-#pragma once
-
-#include <UIMLView.h>
-#include <Either.h>
-#include <VecN.h>
-
-#include "NetworkAPIProcessor.h"
-#include "InventoryView.h"
-
-
-class CraftingGridElement : public Framework::UIMLElement
-{
-public:
-	CraftingGridElement();
-	//! prüft, ob dieses UIML Element für ein bestimmtes xml Element zuständig ist
-	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;
-	//! wendet die layout parameter zu einer Zeichnung an
-	void layout(Framework::XML::Element& element, Framework::Zeichnung& z, int pWidth, int pHeight, Framework::UIMLContainer& generalLayouter) override;
-};
-
-class CraftingGridView : public Framework::ZeichnungHintergrund, public NetworkAPIProcessor, public InventoryDragSource
-{
-private:
-	int rowSize;
-	int colSize;
-	int numOutputSlots;
-	// entity id or block position
-	Framework::Either<int, Framework::VecN<int, 4>> target;
-	Framework::Array<SlotInfo>* slots;
-	Framework::Array<SlotInfo>* outputs;
-	Framework::Text id;
-	int dragStartId;
-	int dragStopId;
-	Framework::Knopf* craft;
-	int currentTooltipSlot;
-	int requestetTooltipSlot;
-	int getSlotByLocalPos(Framework::Punkt pos);
-
-public:
-	CraftingGridView(Framework::Text id, int rowSize, int colSize, int numOutputSlots, Framework::Either<int, Framework::VecN<int, 4>> target);
-	~CraftingGridView();
-	void api(char* message) override;
-	bool tick(double tickVal) override;
-	void render(Framework::Bild& rObj) override;
-	void doMausEreignis(Framework::MausEreignis& me, bool userRet) override;
-	Framework::Either<int, Framework::VecN<int, 4>> getInventoryTarget() const override;
-};

+ 0 - 18
enc_temp_folder/daab62b53a5e77ff5b74c75dfd9d368/Registries.h

@@ -1,18 +0,0 @@
-#pragma once
-
-#include "StaticRegistry.h"
-#include "WorldUpdate.h"
-#include "BlockType.h"
-#include "ItemType.h"
-#include "EntityType.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;

+ 0 - 26
enc_temp_folder/db15399a5a58f3136329d834c5e88aa/WorldUpdate.cpp

@@ -1,26 +0,0 @@
-#include "WorldUpdate.h"
-
-#include "Registries.h"
-#include <Text.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 - 447
enc_temp_folder/eadbdf47d7cfcc5ecf485550d574c/CraftingGrid.cpp

@@ -1,447 +0,0 @@
-#include <XML.h>
-
-#include "CraftingGrid.h"
-#include "Globals.h"
-#include "DragController.h"
-#include "Game.h"
-#include "UIMLToolTip.h"
-
-using namespace Framework;
-
-CraftingGridElement::CraftingGridElement()
-	: UIMLElement()
-{}
-
-//! prüft, ob dieses UIML Element für ein bestimmtes xml Element zuständig ist
-bool CraftingGridElement::isApplicableFor(Framework::XML::Element& element)
-{
-	return element.getName().istGleich("craftingGrid");
-}
-
-//! erstellt eine neue Zeichnung zu einem gegebenen xml Element
-Framework::Zeichnung* CraftingGridElement::parseElement(Framework::XML::Element& element, Framework::UIMLContainer& generalFactory)
-{
-	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();
-	}
-	return new CraftingGridView(element.getAttributeValue("id"), (int)element.getAttributeValue("rowSize"), (int)element.getAttributeValue("colSize"), (int)element.getAttributeValue("numOutputSlots"), target);
-}
-
-//! wendet die layout parameter zu einer Zeichnung an
-void CraftingGridElement::layout(Framework::XML::Element& element, Framework::Zeichnung& z, int pWidth, int pHeight, Framework::UIMLContainer& generalLayouter)
-{
-	UIMLElement::layout(element, z, pWidth, pHeight, generalLayouter);
-}
-
-
-CraftingGridView::CraftingGridView(Text id, int rowSize, int colSize, int numOutputSlots, Either<int, VecN<int, 4>> target)
-	: ZeichnungHintergrund(),
-	rowSize(rowSize),
-	colSize(colSize),
-	numOutputSlots(numOutputSlots),
-	target(target),
-	slots(0),
-	outputs(0),
-	id(id),
-	dragStartId(-1),
-	dragStopId(-1),
-	currentTooltipSlot(-1),
-	requestetTooltipSlot(-1)
-{
-	craft = uiFactory.createKnopf(uiFactory.initParam);
-	craft->setPosition(rowSize * 60, 10);
-	craft->setSize(40, 20);
-	craft->setText("Craft");
-	craft->setMausEreignis([this](void* p, void* o, MausEreignis me)
-		{
-			if (me.id == ME_RLinks)
-			{
-				char* msg = new char[2 + (this->target.isA() ? 4 : 16)];
-				msg[0] = 7; // request crafting
-				msg[1] = (char)this->target.isA();
-				if (msg[1])
-					*(int*)(msg + 2) = this->target.getA();
-				else
-				{
-					*(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];
-				}
-				World::INSTANCE->zClient()->sendPlayerAction(msg, 2 + (this->target.isA() ? 4 : 16));
-				delete[] msg;
-			}
-			return 1;
-		});
-	setStyle(ZeichnungHintergrund::Style::Sichtbar | ZeichnungHintergrund::Style::Erlaubt);
-	char* msg = new char[id.getLength() + 12 + 3];
-	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);
-	World::INSTANCE->zClient()->inventoryAPIRequest(target, msg, id.getLength() + 12 + 3);
-	delete[] msg;
-	setNeedToolTipEvent([this](Zeichnung* z, Punkt p)
-		{
-			int slot = getSlotByLocalPos(p);
-			if (currentTooltipSlot != slot)
-			{
-				this->setToolTipZ(0);
-				currentTooltipSlot = -1;
-			}
-			else
-				return;
-			if (requestetTooltipSlot != slot)
-			{
-				requestetTooltipSlot = slot;
-				char* msg = new char[this->id.getLength() + 6];
-				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;
-				World::INSTANCE->zClient()->inventoryAPIRequest(this->target, msg, this->id.getLength() + 6);
-			}
-		});
-}
-
-CraftingGridView::~CraftingGridView()
-{
-	DragController<InventoryDragSource, int>* controller = ((Game*)(Menu*)menuRegister->get("game"))->zInventoryDragController();
-	if (controller->getCurrentDragContainer() == this)
-		controller->stopDrag();
-	if (slots)
-		slots->release();
-	if (outputs)
-		outputs->release();
-	char* msg = new char[id.getLength() + 2];
-	msg[0] = 1;
-	msg[1] = (char)id.getLength();
-	memcpy(msg + 2, id.getText(), id.getLength());
-	World::INSTANCE->zClient()->inventoryAPIRequest(target, msg, id.getLength() + 2);
-	delete[] msg;
-	craft->release();
-}
-
-int CraftingGridView::getSlotByLocalPos(Punkt pos)
-{
-	int x = 0;
-	int y = 0;
-	int rowCount = 0;
-	int slot = 0;
-	dragStopId = -1;
-	if (slots)
-	{
-		for (SlotInfo info : *slots)
-		{
-			if (pos.x >= x && pos.x < x + 50 && pos.y >= y && pos.y < y + 50)
-				return info.id;
-			x += 60;
-			if (++rowCount >= rowSize)
-			{
-				y += 60;
-				x = 0;
-				rowCount = 0;
-			}
-			slot++;
-		}
-	}
-	return -1;
-}
-
-void CraftingGridView::api(char* message)
-{
-	switch (message[0])
-	{
-	case 0:
-		// send inventory content
-	{
-		Array<SlotInfo>* slots = new Array<SlotInfo>();
-		int count = *(int*)(++message);
-		for (int i = 0; i < count; i++)
-		{
-			SlotInfo info;
-			info.id = *(int*)(message += 4);
-			info.itemCount = *(int*)(message += 4);
-			if (info.itemCount > 0)
-			{
-				info.hp = *(float*)(message += 4);
-				info.maxHp = *(float*)(message += 4);
-				info.durability = *(float*)(message += 4);
-				info.maxDurability = *(float*)(message += 4);
-                info.zItem = zItemType(*(int*)(message += 4))->zIcon();
-			}
-			slots->add(info);
-		}
-		postAction([this, slots]()
-			{
-				if (this->slots)
-					this->slots->release();
-				this->slots = slots;
-			});
-		break;
-	}
-	case 1: // set count of items
-	{
-		if (!slots)
-			return;
-		int id = *(int*)(message + 1);
-		int count = *(int*)(message + 5);
-		for (int i = 0; i < slots->getEintragAnzahl(); i++)
-		{
-			if (slots->get(i).id == id)
-			{
-				SlotInfo info = slots->get(i);
-				info.itemCount = count;
-				if (info.itemCount == 0)
-				{
-					DragController<InventoryDragSource, int>* controller = ((Game*)(Menu*)menuRegister->get("game"))->zInventoryDragController();
-					if (controller && controller->getCurrentDragContainer() == this && controller->getCurrentDaragElement() == info.id)
-					{
-						controller->stopDrag();
-					}
-				}
-				slots->set(info, i);
-				break;
-			}
-		}
-		break;
-	}
-	case 2: // add new stack
-	{
-		if (!slots)
-			return;
-		int id = *(int*)(message + 1);
-		for (int i = 0; i < slots->getEintragAnzahl(); i++)
-		{
-			if (slots->get(i).id == id)
-			{
-				SlotInfo info = slots->get(i);
-				info.itemCount = *(int*)(message + 5);
-				info.hp = *(float*)(message + 9);
-				info.maxHp = *(float*)(message + 13);
-				info.durability = *(float*)(message + 17);
-				info.maxDurability = *(float*)(message + 21);
-                info.zItem = zItemType(*(int*)(message + 25))->zIcon();
-				slots->set(info, i);
-				break;
-			}
-		}
-		break;
-	}
-	case 3: // receive tooltip uiml
-	{
-		int slotId = *(int*)(message + 1);
-		if (slotId == requestetTooltipSlot)
-		{
-			short len = *(short*)(message + 5);
-			char* uiml = new char[len + 1];
-			memcpy(uiml, message + 7, len);
-			uiml[len] = 0;
-			UIMLToolTip* tip = new UIMLToolTip();
-			tip->setUIML(uiml);
-			setToolTipZ(tip);
-			delete[] uiml;
-			currentTooltipSlot = slotId;
-			requestetTooltipSlot = -1;
-		}
-		break;
-	}
-	case 100: // set crafting result
-	{
-		Array<SlotInfo>* outputs = new Array<SlotInfo>();
-		int count = *(int*)(++message);
-		for (int i = 0; i < count; i++)
-		{
-			SlotInfo info;
-			info.id = i;
-			info.itemCount = *(int*)(message += 4);
-			if (info.itemCount > 0)
-			{
-				info.hp = *(float*)(message += 4);
-				info.maxHp = *(float*)(message += 4);
-				info.durability = *(float*)(message += 4);
-				info.maxDurability = *(float*)(message += 4);
-                info.zItem = zItemType(*(int*)(message += 4))->zIcon();
-			}
-			outputs->add(info);
-		}
-		postAction([this, outputs]()
-			{
-				if (this->outputs)
-					this->outputs->release();
-				this->outputs = outputs;
-			});
-		break;
-	}
-	}
-}
-
-bool CraftingGridView::tick(double tickVal)
-{
-	return ZeichnungHintergrund::tick(tickVal);
-}
-
-void CraftingGridView::render(Bild& rObj)
-{
-	ZeichnungHintergrund::render(rObj);
-	if (!rObj.setDrawOptions(pos.x, pos.y, gr.x, gr.y))
-		return;
-	int numRows = 1;
-	if (slots)
-	{
-		int x = 0;
-		int y = 0;
-		int rowCount = 0;
-		int index = 0;
-		for (SlotInfo info : *slots)
-		{
-			info.render(x, y, rObj, dragStartId == info.id, dragStopId == info.id);
-			x += 60;
-			if (++rowCount >= rowSize)
-			{
-				y += 60;
-				x = 0;
-				rowCount = 0;
-				if (index < slots->getEintragAnzahl() - 1)
-					numRows++;
-			}
-			index++;
-		}
-	}
-	craft->render(rObj);
-	rObj.fillRegion(rowSize * 60, gr.y / 2 - 5, 25, 10, 0xFF52525E);
-	rObj.drawDreieck(Punkt(rowSize * 60 + 25, gr.y / 2 - 15), Punkt(rowSize * 60 + 40, gr.y / 2), Punkt(rowSize * 60 + 25, gr.y / 2 + 15), 0xFF52525E);
-	if (outputs)
-	{
-		int x = rowSize * 60 + 50;
-		int y = 0;
-		int colCount = 0;
-		for (SlotInfo info : *outputs)
-		{
-			info.render(x, y, rObj, dragStartId == info.id, dragStopId == info.id);
-			y += 60;
-			if (++colCount >= numRows)
-			{
-				x += 60;
-				y = 0;
-				colCount = 0;
-			}
-		}
-	}
-	rObj.releaseDrawOptions();
-}
-
-void CraftingGridView::doMausEreignis(MausEreignis& me, bool userRet)
-{
-	if (!slots)
-		return;
-	if (me.id == ME_Bewegung)
-	{
-		if (getSlotByLocalPos(Punkt(me.mx, me.my)) != currentTooltipSlot)
-		{
-			setToolTipZ(0);
-			currentTooltipSlot = -1;
-		}
-	}
-	craft->doPublicMausEreignis(me);
-	DragController<InventoryDragSource, int>* controller = ((Game*)(Menu*)menuRegister->get("game"))->zInventoryDragController();
-	int x = 0;
-	int y = 0;
-	int rowCount = 0;
-	int slot = 0;
-	dragStopId = -1;
-	for (SlotInfo info : *slots)
-	{
-		if (me.mx >= x && me.mx < x + 50 && me.my >= y && me.my < y + 50)
-		{
-			if (me.id == ME_RLinks)
-			{
-				if (!controller->getCurrentDragContainer() && info.itemCount > 0)
-				{
-					controller->beginDrag(this, info.id, info.zItem, [this]()
-						{
-							dragStartId = -1;
-						});
-					dragStartId = info.id;
-				}
-				else if (controller->getCurrentDragContainer())
-				{
-					// request to transfer items from source to target slot
-					Framework::Either<int, Framework::VecN<int, 4>> source = controller->getCurrentDragContainer()->getInventoryTarget();
-					int len = 2 + (source.isA() ? 4 : 16) + 5 + (target.isA() ? 4 : 16) + 4;
-					char* msg = new char[len];
-					int index = 0;
-					msg[index++] = 6;
-					msg[index++] = (char)source.isA();
-					if (source.isA())
-					{
-						*(int*)(msg + index) = source.getA();
-						index += 4;
-					}
-					else
-					{
-						*(int*)(msg + index) = source.getB()[0];
-						*(int*)(msg + index + 4) = source.getB()[1];
-						*(int*)(msg + index + 8) = source.getB()[2];
-						*(int*)(msg + index + 12) = source.getB()[3];
-						index += 16;
-					}
-					*(int*)(msg + index) = controller->getCurrentDaragElement();
-					index += 4;
-					msg[index++] = target.isA();
-					if (target.isA())
-					{
-						*(int*)(msg + index) = target.getA();
-						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];
-						index += 16;
-					}
-					*(int*)(msg + index) = info.id;
-					World::INSTANCE->zClient()->sendPlayerAction(msg, len);
-					delete[] msg;
-				}
-			}
-			else
-			{
-				if (controller->getCurrentDragContainer() && (controller->getCurrentDragContainer() != this || controller->getCurrentDaragElement() != info.id))
-				{
-					dragStopId = info.id;
-				}
-			}
-			break;
-		}
-		x += 60;
-		if (++rowCount >= rowSize)
-		{
-			y += 60;
-			x = 0;
-			rowCount = 0;
-		}
-		slot++;
-	}
-	ZeichnungHintergrund::doMausEreignis(me, userRet);
-}
-
-Framework::Either<int, Framework::VecN<int, 4>> CraftingGridView::getInventoryTarget() const
-{
-	return target;
-}

+ 0 - 56
enc_temp_folder/eb39f2494bc1df93bab2e22e54d5/World.h

@@ -1,56 +0,0 @@
-#pragma once
-
-#include <Welt3D.h>
-#include <Bildschirm.h>
-#include <Kam3D.h>
-#include <Thread.h>
-
-#include "Dimension.h"
-#include "PlayerKam.h"
-#include "FactoryClient.h"
-
-class World : public Framework::Thread
-{
-public:
-	static World* INSTANCE;
-	
-private:
-	Dimension* currentDimension;
-	Framework::Welt3D* renderedWorld;
-	Framework::Bildschirm3D* zScreenPtr;
-	PlayerKam* kam;
-	bool firstMessage;
-	int ownEntityId;
-	Framework::Model3D* currentTarget;
-	Array<Punkt> subscriptions;
-	FactoryClient* client;
-	Critical subLock;
-	Critical targetLock;
-
-public:
-	World(Framework::Bildschirm3D* zScreen, FactoryClient* client);
-	~World();
-	void update(bool background);
-	void setChunk(Chunk* chunk);
-	void thread() override;
-
-	Block* zBlockAt(Framework::Vec3<int> location) const;
-	Block* getBlockAt(Framework::Vec3<int> location) const;
-	Dimension* zDimension() const;
-	void setVisibility(Chunk* zChunk, bool visible);
-	void setVisibility(Entity* zEntity, bool visible);
-	Framework::Punkt getChunkCenter(int x, int y) const;
-	Entity* zEntity(int id) const;
-	Entity* getEntity(int id) const;
-	void removeEntity(int id);
-	PlayerKam* zKamera() const;
-	int getCurrentPlayerId() const;
-	Entity* getCurrentPlayerEntity() const;
-	void setTarget(Framework::Model3D* zTarget);
-	void lockWorld();
-	void unlockWorld();
-	void onChunkAdded(Punkt pos);
-	Chunk* zChunk(Punkt center);
-	Framework::Model3D* getCurrentTarget() const;
-	FactoryClient* zClient() const;
-};

+ 0 - 47
enc_temp_folder/ef2be821964b97a79f24226c6ce03c60/Entity.h

@@ -1,47 +0,0 @@
-#pragma once
-
-#include <Model3D.h>
-#include <Either.h>
-#include <Critical.h>
-
-#include "EntityType.h"
-#include "Area.h"
-
-class Block;
-
-struct MovementFrame
-{
-	Framework::Vec3<float> direction;
-	Framework::Vec3<float> targetPosition;
-	int movementFlags;
-	double duration;
-};
-
-class Entity : public Framework::Model3D
-{
-private:
-	int id;
-	const EntityType* zType;
-	Framework::Critical cs;
-	bool playerControlled;
-	float maxMovementSpeed;
-	int lastFlags;
-	double timeSinceSync;
-	Framework::Vec3<float> lastDirection;
-	Framework::Array< MovementFrame > movements;
-	Framework::Vec3<float> speed;
-	MovementFrame currentFrame;
-
-public:
-	Entity(const EntityType* zType, Framework::Model3DData* model, Framework::Model3DTextur* texture, int id, Framework::Vec3<float> position, float maxMovementSpeed);
-	~Entity();
-
-	void api(char* message);
-	bool tick(double time) override;
-
-	int getId() const;
-	const EntityType* zEntityType() const;
-	void lock();
-	void unlock();
-	void setPlayerControlled();
-};

+ 0 - 165
enc_temp_folder/f68e3c78e417e9bed1beacfd7bb406b/ItemBar.cpp

@@ -1,165 +0,0 @@
-#include <XML.h>
-#include <Bild.h>
-
-#include "ItemBar.h"
-#include "Globals.h"
-
-using namespace Framework;
-
-ItemBarElement::ItemBarElement()
-	: UIMLElement()
-{}
-
-//! prüft, ob dieses UIML Element für ein bestimmtes xml Element zuständig ist
-bool ItemBarElement::isApplicableFor(Framework::XML::Element& element)
-{
-	return element.getName().istGleich("itemBar");
-}
-
-//! erstellt eine neue Zeichnung zu einem gegebenen xml Element
-Framework::Zeichnung* ItemBarElement::parseElement(Framework::XML::Element& element, Framework::UIMLContainer& generalFactory)
-{
-	return new ItemBarView(element.getAttributeValue("id"), (int)element.getAttributeValue("rowSize"), (int)element.getAttributeValue("target"), element.getAttributeValue("slotNameFilter"));
-}
-
-//! wendet die layout parameter zu einer Zeichnung an
-void ItemBarElement::layout(Framework::XML::Element& element, Framework::Zeichnung& z, int pWidth, int pHeight, Framework::UIMLContainer& generalLayouter)
-{
-	UIMLElement::layout(element, z, pWidth, pHeight, generalLayouter);
-}
-
-
-ItemBarView::ItemBarView(Framework::Text id, int rowSize, int targetEntity, Framework::Text slotNameFilter)
-	: ZeichnungHintergrund(),
-	id(id),
-	rowSize(rowSize),
-	targetEntity(targetEntity),
-	slotNameFilter(slotNameFilter),
-	slots(0),
-	leftHandPos(0)
-{
-	char* msg = new char[id.getLength() + slotNameFilter.getLength() + 3];
-	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(), slotNameFilter.getText(), slotNameFilter.getLength());
-	World::INSTANCE->zClient()->inventoryAPIRequest(targetEntity, msg, id.getLength() + slotNameFilter.getLength() + 3);
-	delete[] msg;
-}
-
-ItemBarView::~ItemBarView()
-{
-	if (slots)
-		slots->release();
-	char* msg = new char[id.getLength() + 2];
-	msg[0] = 1;
-	msg[1] = (char)id.getLength();
-	memcpy(msg + 2, id.getText(), id.getLength());
-	msg[2 + id.getLength()] = (char)slotNameFilter.getLength();
-	World::INSTANCE->zClient()->inventoryAPIRequest(targetEntity, msg, id.getLength() + 2);
-	delete[] msg;
-}
-
-void ItemBarView::api(char* message)
-{
-	switch (message[0])
-	{
-	case 0:
-		// send inventory content
-	{
-		Array<SlotInfo>* slots = new Array<SlotInfo>();
-		int count = *(int*)(++message);
-		for (int i = 0; i < count; i++)
-		{
-			SlotInfo info;
-			info.id = *(int*)(message += 4);
-			info.itemCount = *(int*)(message += 4);
-			if (info.itemCount > 0)
-			{
-				info.hp = *(float*)(message += 4);
-				info.maxHp = *(float*)(message += 4);
-				info.durability = *(float*)(message += 4);
-				info.maxDurability = *(float*)(message += 4);
-                info.zItem = zItemType(*(int*)(message += 4))->zIcon();
-			}
-			slots->add(info);
-		}
-		postAction([this, slots]()
-			{
-				if (this->slots)
-					this->slots->release();
-				this->slots = slots;
-			});
-		break;
-	}
-	case 1: // set count of items
-	{
-		int id = *(int*)(message + 1);
-		int count = *(int*)(message + 5);
-		for (int i = 0; i < slots->getEintragAnzahl(); i++)
-		{
-			if (slots->get(i).id == id)
-			{
-				SlotInfo info = slots->get(i);
-				info.itemCount = count;
-				slots->set(info, i);
-				break;
-			}
-		}
-		break;
-	}
-	case 2: // add new stack
-	{
-		int id = *(int*)(message + 1);
-		for (int i = 0; i < slots->getEintragAnzahl(); i++)
-		{
-			if (slots->get(i).id == id)
-			{
-				SlotInfo info = slots->get(i);
-				info.itemCount = *(int*)(message + 5);
-				info.hp = *(float*)(message + 9);
-				info.maxHp = *(float*)(message + 13);
-				info.durability = *(float*)(message + 17);
-				info.maxDurability = *(float*)(message + 21);
-                info.zItem = zItemType(*(int*)(message + 25))->zIcon();
-				slots->set(info, i);
-				break;
-			}
-		}
-		break;
-	}
-	case 3: // set selected slot
-	{
-		leftHandPos = *(int*)(message + 1);
-		break;
-	}
-	}
-}
-
-void ItemBarView::render(Bild& rObj)
-{
-	ZeichnungHintergrund::render(rObj);
-	if (!rObj.setDrawOptions(pos.x, pos.y, gr.x, gr.y))
-		return;
-	if (slots)
-	{
-		int x = 0;
-		int y = 0;
-		int rowCount = 0;
-		int index = 0;
-		for (SlotInfo info : *slots)
-		{
-			info.render(x, y, rObj, index == leftHandPos, index == (leftHandPos + 1) % slots->getEintragAnzahl());
-			x += 60;
-			if (++rowCount >= rowSize)
-			{
-				y += 60;
-				x = 0;
-				rowCount = 0;
-			}
-			index++;
-		}
-	}
-	rObj.releaseDrawOptions();
-}