Browse Source

fix some compiler errors

Kolja Strohm 3 years ago
parent
commit
773660631b

+ 3 - 1
FactoryCraft/BlockType.h

@@ -1,6 +1,8 @@
 #pragma once
 
-#include <Writer.h>
+#include <Reader.h>
+#include <ReferenceCounter.h>
+#include <Vec3.h>
 
 #include "StaticRegistry.h"
 

+ 2 - 1
FactoryCraft/Chunk.h

@@ -2,9 +2,10 @@
 
 #include <Punkt.h>
 
-#include "Block.h"
 #include "Area.h"
 
+class Block;
+
 class Chunk : public virtual Framework::ReferenceCounter
 {
 private:

+ 1 - 1
FactoryCraft/FactoryClient.h

@@ -11,7 +11,7 @@ private:
     Network::SSLKlient *client;
     bool connected;
     void disconnect();
-    NetworkReader *reader;
+    Network::NetworkReader *reader;
 
 public:
     FactoryClient();

+ 2 - 0
FactoryCraft/Game.h

@@ -1,5 +1,7 @@
 #pragma once
 
+#include <Knopf.h>
+
 #include "Menu.h"
 
 class Game : public Menu

+ 1 - 1
FactoryCraft/Inventoty.cpp

@@ -27,7 +27,7 @@ void Inventory::loadInventory( Framework::StreamReader *zReader )
             int id = 0;
             zReader->lese( (char *)&id, 4 );
             Item *item = StaticRegistry<ItemType>::INSTANCE.zElement( id )->loadItem( zReader );
-            iterator->addItems( new ItemStack( item, size ), NO_DIRECTION );
+            iterator->setItems( new ItemStack( item, size ) );
         }
     }
 }

+ 12 - 1
FactoryCraft/ItemSlot.cpp

@@ -10,4 +10,15 @@ ItemSlot::ItemSlot( int maxSize, int pullPriority, int pushPriority, int allowed
     pullPriority( pullPriority ),
     pushPriority( pushPriority ),
     allowHigherStackSize( allowHigherStackSize )
-{}
+{}
+
+ItemSlot::~ItemSlot()
+{
+    if( items )
+        items->release();
+}
+
+void ItemSlot::setItems( ItemStack *item )
+{
+    this->items = items;
+}

+ 3 - 0
FactoryCraft/ItemSlot.h

@@ -16,4 +16,7 @@ private:
 
 public:
     ItemSlot( int maxSize, int pullPriority, int pushPriority, int allowedPullSide, int allowedPushSides, bool allowHigherStackSize );
+    ~ItemSlot();
+
+    void setItems( ItemStack *item );
 };

+ 6 - 0
FactoryCraft/ItemStack.cpp

@@ -13,6 +13,12 @@ ItemStack::ItemStack( Item *item, int currentSize )
     : ItemStack( item, currentSize, item->getMaxStackSize() )
 {}
 
+ItemStack::~ItemStack()
+{
+    if( item )
+        item->release();
+}
+
 int ItemStack::getSize() const
 {
     return size;

+ 1 - 0
FactoryCraft/ItemStack.h

@@ -12,6 +12,7 @@ private:
 public:
     ItemStack( Item *item, int currentSize, int maxSize );
     ItemStack( Item *item, int currentSize );
+    ~ItemStack();
 
     int getSize() const;
     int getMaxSize() const;

+ 1 - 0
FactoryCraft/NetworkHandler.cpp

@@ -100,4 +100,5 @@ bool NetworkHandler::leaveGame()
         fc->release();
         fc = 0;
     }
+    return 1;
 }

+ 3 - 1
FactoryCraft/World.h

@@ -1,5 +1,7 @@
 #pragma once
 
+#include <Welt3D.h>
+
 #include "Dimension.h"
 #include "CurrentPlayer.h"
 
@@ -8,7 +10,7 @@ class World : public Framework::ReferenceCounter
 private:
     Framework::RCArray<Dimension> *dimensions;
     CurrentPlayer *currentPlayer;
-    Welt3D *renderedWorld;
+    Framework::Welt3D *renderedWorld;
 
 public:
     World();