Browse Source

removal of std maps and vectors, removal of several dynamic memory
allocations

Kajetan Johannes Hammerle 3 years ago
parent
commit
4c682b60c0

+ 2 - 4
client/Game.cpp

@@ -1,5 +1,3 @@
-#include <sstream>
-
 #include "client/Game.h"
 #include "client/utils/Utils.h"
 #include "rendering/Renderer.h"
@@ -142,7 +140,7 @@ void Game::tick() {
         renderSettings.testBias *= 0.95f;
     }*/
 
-    testAngle += 5.0;
+    testAngle += 5.0f;
 }
 
 void Game::renderWorld(float lag, Renderer& renderer) const {
@@ -175,4 +173,4 @@ void Game::renderTextOverlay(float lag, Renderer& renderer, FontRenderer& fr) co
 
 bool Game::isRunning() const {
     return true;
-}
+}

+ 6 - 0
client/Main.cpp

@@ -9,6 +9,7 @@
 #include "client/rendering/Engine.h"
 #include "client/utils/Clock.h"
 #include "client/rendering/RenderSettings.h"
+#include "common/block/BlockRegistry.h"
 
 bool initGLEW() {
     GLenum err = glewInit();
@@ -82,6 +83,11 @@ int main() {
     
     initCallbacks(window, size, framebuffers, control);
     window.show();
+    
+    BlockRegistry registry;
+    registry.forEach([](const Block& b){
+        std::cout << b.getRegistry() << "\n";
+    });
 
     const u64 nanosPerTick = 50000000;
     u64 lag = 0;

+ 1 - 2
client/rendering/Engine.cpp

@@ -9,8 +9,7 @@
 
 Engine::Engine(Shaders& shaders, Framebuffers& fb, Camera& camera, const WindowSize& size,
         RenderSettings& renderSettings) :
-shaders(shaders), fb(fb), camera(camera), size(size), renderSettings(renderSettings), frustum(60.0f, 0.1f, 80.0f),
-ssaoNoise(4, 4) {
+shaders(shaders), fb(fb), camera(camera), size(size), renderSettings(renderSettings), frustum(60.0f, 0.1f, 80.0f) {
     rectangle.add( {-1, -1, 0, 0, 0, 0, 0, 0});
     rectangle.add( {1, 1, 0, 1, 1, 0, 0, 0});
     rectangle.add( {-1, 1, 0, 0, 1, 0, 0, 0});

+ 5 - 6
client/rendering/FileTexture.cpp

@@ -2,12 +2,11 @@
 #include "client/utils/PNGReader.h"
 
 FileTexture::FileTexture(const char* path) {
-    u32 width;
-    u32 height;
-    u32* data = PNGReader::load(path, width, height);
-    if(data != nullptr) {
-        texture.setRGBAData(width, height, data);
-        delete[] data;
+    u32 maxWidth = 256;
+    u32 maxHeight = 256;
+    u32 buffer[256 * 256];
+    if(PNGReader::load(path, buffer, maxWidth, maxHeight)) {
+        texture.setRGBAData(maxWidth, maxHeight, buffer);
     }
 }
 

+ 3 - 3
client/rendering/Mesh.cpp

@@ -8,7 +8,7 @@ Mesh::Mesh() {
 }
 
 void Mesh::add(const VertexData& data) {
-    buffer.push_back(data);
+    buffer.add(data);
 }
 
 void Mesh::clear() {
@@ -17,10 +17,10 @@ void Mesh::clear() {
 
 void Mesh::build() {
     vertexBuffer.bindBuffer();
-    vertexBuffer.setData(sizeof (VertexData) * buffer.size(), buffer.data());
+    vertexBuffer.setData(sizeof (VertexData) * buffer.getLength(), buffer.getData());
 }
 
 void Mesh::draw() const {
     vertexBuffer.bindArray();
-    vertexBuffer.draw(buffer.size());
+    vertexBuffer.draw(buffer.getLength());
 }

+ 2 - 3
client/rendering/Mesh.h

@@ -1,9 +1,8 @@
 #ifndef MESH_H
 #define MESH_H
 
-#include <vector>
-
 #include "client/rendering/wrapper/VertexBuffer.h"
+#include "common/utils/List.h"
 
 class Mesh final {
 public:
@@ -29,7 +28,7 @@ public:
 
 private:
     VertexBuffer vertexBuffer;
-    std::vector<VertexData> buffer;
+    List<VertexData, 4096> buffer;
 };
 
 #endif

+ 8 - 17
client/rendering/NoiseTexture.cpp

@@ -1,25 +1,16 @@
-#include <vector>
-#include <cstdlib>
-
 #include "client/rendering/NoiseTexture.h"
+#include "common/utils/Random.h"
+#include "common/utils/List.h"
 
-NoiseTexture::NoiseTexture(uint width, uint height) {
-    std::vector<float> data;
-    for(uint x = 0; x < width; x++) {
-        for(uint y = 0; y < height; y++) {
-            data.push_back(getRandom());
-            data.push_back(getRandom());
-            data.push_back(getRandom());
-        }
+NoiseTexture::NoiseTexture() {
+    Random r(1);
+    List<float, 48> data;
+    for(uint i = 0; i < data.getCapacity(); i++) {
+        data.add(r.nextFloat() * 2.0f - 1.0f);
     }
-    texture.setRGBFloatData(width, height, data.data());
+    texture.setRGBFloatData(4, 4, data.getData());
 }
 
 void NoiseTexture::bind(uint index) const {
     texture.bind(index);
 }
-
-float NoiseTexture::getRandom() const {
-    float r = static_cast<float> (rand()) / static_cast<float> (RAND_MAX);
-    return r * 2.0f - 1.0f;
-}

+ 1 - 4
client/rendering/NoiseTexture.h

@@ -2,17 +2,14 @@
 #define NOISETEXTURE_H
 
 #include "client/rendering/wrapper/Texture.h"
-#include "common/utils/Types.h"
 
 class NoiseTexture final {
 public:
-    NoiseTexture(uint width, uint height);
+    NoiseTexture();
 
     void bind(uint index) const;
 
 private:
-    float getRandom() const;
-    
     Texture texture;
 };
 

+ 21 - 15
client/utils/PNGReader.cpp

@@ -17,21 +17,21 @@ static bool checkSignature(const char* path, FILE* file) {
     return false;
 }
 
-static u32* load(const char* path, FILE* file, u32& width, u32& height) {
+static bool load(const char* path, FILE* file, u32* buffer, u32& maxWidth, u32& maxHeight) {
     if(checkSignature(path, file)) {
-        return nullptr;
+        return false;
     }
 
     png_structp png = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
     if(png == nullptr) {
         std::cout << "cannot create texture data structure\n";
-        return nullptr;
+        return false;
     }
 
     png_infop info = png_create_info_struct(png);
     if(info == nullptr) {
         std::cout << "cannot create image info structure\n";
-        return nullptr;
+        return false;
     }
 
     u32** rowPointers = nullptr;
@@ -42,21 +42,27 @@ static u32* load(const char* path, FILE* file, u32& width, u32& height) {
         }
         png_destroy_read_struct(&png, &info, nullptr);
         std::cout << "texture '" << path << "' has used error callback\n";
-        return nullptr;
+        return false;
     }
 
     png_init_io(png, file); // set reading function
     png_set_sig_bytes(png, 8); // notify about already used signature bytes
 
     png_read_info(png, info); // read info data
-    width = png_get_image_width(png, info);
-    height = png_get_image_height(png, info);
-
+    
+    u32 width = png_get_image_width(png, info);
+    u32 height = png_get_image_height(png, info);
+    if(width > maxWidth || height > maxHeight) {
+        std::cout << "texture '" << path << "' is too big: " << maxWidth << " x " << maxHeight << " allowed\n";
+        return false;
+    }
+    maxWidth = width;
+    maxHeight = height;
+    
     // allocate and set row pointer to correct places in block
-    u32* data = new u32[width * height];
     rowPointers = static_cast<u32**> (png_malloc(png, height * (sizeof (u32*))));
     for(uint i = 0; i < height; i++) {
-        rowPointers[i] = (data + i * width);
+        rowPointers[i] = (buffer + i * width);
     }
     png_set_rows(png, info, reinterpret_cast<png_bytepp> (rowPointers));
 
@@ -64,16 +70,16 @@ static u32* load(const char* path, FILE* file, u32& width, u32& height) {
 
     png_free(png, rowPointers);
     png_destroy_read_struct(&png, &info, nullptr);
-    return data;
+    return true;
 }
 
-u32* PNGReader::load(const char* path, u32& width, u32& height) {
+bool PNGReader::load(const char* path, u32* buffer, u32& maxWidth, u32& maxHeight) {
     FILE* file = fopen(path, "r");
     if(file == nullptr) {
         std::cout << "texture '" << path << "' cannot be read: " << strerror(errno) << "\n";
-        return nullptr;
+        return false;
     }
-    u32* data = load(path, file, width, height);
+    bool result = load(path, file, buffer, maxWidth, maxHeight);
     fclose(file);
-    return data;
+    return result;
 }

+ 1 - 1
client/utils/PNGReader.h

@@ -4,7 +4,7 @@
 #include "common/utils/Types.h"
 
 namespace PNGReader {
-    u32* load(const char* path, u32& width, u32& height);
+    bool load(const char* path, u32* buffer, u32& maxWidth, u32& maxHeight);
 }
 
 #endif

+ 3 - 0
common/block/Block.cpp

@@ -1,5 +1,8 @@
 #include "common/block/Block.h"
 
+Block::Block() : id(0), registry("") {
+}
+
 Block::Block(u16 id, const HashedString& registry, const BlockBuilder& builder) : id(id), registry(registry) {
     (void) builder;
 }

+ 3 - 2
common/block/Block.h

@@ -6,13 +6,14 @@
 
 class Block final {
 public:
+    Block();
     Block(u16 id, const HashedString& registry, const BlockBuilder& builder);
     u16 getId() const;
     const HashedString& getRegistry() const;
 
 private:
-    const u16 id;
-    const HashedString registry;
+    u16 id;
+    HashedString registry;
 };
 
 #endif

+ 16 - 14
common/block/BlockRegistry.cpp

@@ -1,28 +1,30 @@
 #include "common/block/BlockRegistry.h"
 
-BlockRegistry::BlockRegistry() {
-    add("air", BlockBuilder().test());
-    add("stone", BlockBuilder().test());
-    add("dirt", BlockBuilder().test());
-    add("grass", BlockBuilder().test());
+BlockRegistry::BlockRegistry() : registryToId("air", 0) {
+    add("air", BlockBuilder());
+    add("stone", BlockBuilder());
+    add("dirt", BlockBuilder());
+    add("grass", BlockBuilder());
+}
+
+void BlockRegistry::forEach(void(*f)(const Block&)) const {
+    for(const Block& b : blocks) {
+        f(b);
+    }
 }
 
 void BlockRegistry::add(const char* registry, const BlockBuilder& builder) {
-    u16 id = blocks.size();
-    blocks.emplace_back(id, registry, builder);
-    registryToId[registry] = id;
+    u16 id = blocks.getLength();
+    blocks.add(Block(id, registry, builder));
+    registryToId.add(registry, id);
 }
 
 const Block& BlockRegistry::getBlock(const HashedString& registry) const {
-    auto iter = registryToId.find(registry);
-    if(iter == registryToId.end()) {
-        return blocks[0];
-    }
-    return getBlock(iter->second);
+    return blocks[registryToId.search(registry)];
 }
 
 const Block& BlockRegistry::getBlock(u16 id) const {
-    if(id < blocks.size()) {
+    if(id < blocks.getLength()) {
         return blocks[id];
     }
     return blocks[0];

+ 7 - 5
common/block/BlockRegistry.h

@@ -1,23 +1,25 @@
 #ifndef BLOCKREGISTRY_H
 #define BLOCKREGISTRY_H
 
-#include <vector>
-#include <unordered_map>
-
+#include "common/utils/List.h"
 #include "common/utils/HashedString.h"
+#include "common/utils/HashMap.h"
 #include "common/block/Block.h"
 
 class BlockRegistry final {
 public:
     BlockRegistry();
+    void forEach(void (*f) (const Block&)) const;
     const Block& getBlock(const HashedString& registry) const;
     const Block& getBlock(u16 id) const;
 
 private:
     void add(const char* registry, const BlockBuilder& builder);
 
-    std::vector<Block> blocks;
-    std::unordered_map<HashedString, u16, HashedString::Hasher> registryToId;
+    static constexpr uint MAX_BLOCKS = 4096;
+
+    List<Block, MAX_BLOCKS> blocks;
+    HashMap<HashedString, u16, MAX_BLOCKS> registryToId;
 };
 
 #endif

+ 1 - 0
common/utils/DataVector.cpp

@@ -38,6 +38,7 @@ DataVector& DataVector::operator=(const DataVector& other) {
 
 DataVector& DataVector::operator=(DataVector&& other) {
     if(this != &other) {
+        delete[] data;
         capacity = other.capacity;
         data = other.data;
         other.capacity = 0;

+ 97 - 0
common/utils/HashMap.h

@@ -0,0 +1,97 @@
+#ifndef HASHMAP_H
+#define HASHMAP_H
+
+#include "common/utils/Types.h"
+
+template<typename K, typename V, uint L>
+class HashMap final {
+public:
+
+    HashMap(K emptyKey, V emptyValue) : entries(0), emptyKey(emptyKey), emptyValue(emptyValue) {
+        for(uint i = 0; i < LENGTH; i++) {
+            data[i].key = emptyKey;
+            data[i].value = emptyValue;
+        }
+    }
+
+    static constexpr uint getCapacity() {
+        return LENGTH;
+    }
+
+    void add(const K key, const V value) {
+        if(entries >= L) {
+            return;
+        }
+        uint hash = hashCode(key) % LENGTH;
+        while(true) {
+            if(data[hash].key == key) {
+                data[hash].value = value;
+                return;
+            } else if(data[hash].key == emptyKey) {
+                data[hash].key = key;
+                data[hash].value = value;
+                entries++;
+                return;
+            }
+            hash = (hash + 1) % LENGTH;
+        }
+    }
+
+    V search(const K key) const {
+        uint hash = hashCode(key) % LENGTH;
+        while(true) {
+            if(data[hash].key == key) {
+                return data[hash].value;
+            } else if(data[hash].key == emptyKey) {
+                return emptyValue;
+            }
+            hash = (hash + 1) % LENGTH;
+        }
+    }
+
+    void forEach(void (*f)(const K&, V&)) {
+        for(uint i = 0; i < LENGTH; i++) {
+            if(data[i].key != emptyKey) {
+                f(data[i].key, data[i].value);
+            }
+        }
+    }
+
+private:
+
+    static constexpr uint getLength() {
+        constexpr uint SIZE_TABLE[] = {
+            2, 3, 7, 11, 23, 43, 89, 173, 347, 683, 1367, 2731, 5471, 10937, 21851, 43691, 87383, 174763, 349529, 699053,
+            1398107, 2796203, 5592407, 11184829, 22369661, 44739259, 89478503, 178956983, 357913951, 715827883, 1431655777,
+            2863311551
+        };
+        uint i = 0;
+        while(SIZE_TABLE[i] < L) {
+            i++;
+        }
+        return SIZE_TABLE[i];
+    }
+
+    template<typename H>
+    uint hashCode(const H& h) const {
+        return h.hashCode();
+    }
+
+    uint hashCode(const uint& h) const {
+        return h;
+    }
+
+    static constexpr uint LENGTH = getLength();
+
+    uint entries;
+    K emptyKey;
+    V emptyValue;
+
+    struct KeyValuePair {
+        K key;
+        V value;
+    };
+    KeyValuePair data[LENGTH];
+};
+
+#endif

+ 1 - 5
common/utils/HashedString.cpp

@@ -26,8 +26,4 @@ HashedString::operator const char*() const {
 
 u32 HashedString::hashCode() const {
     return hash;
-}
-
-u32 HashedString::Hasher::operator()(const HashedString& key) const {
-    return key.hash;
-}
+}

+ 1 - 5
common/utils/HashedString.h

@@ -14,10 +14,6 @@ public:
 
     u32 hashCode() const;
 
-    struct Hasher final {
-        u32 operator()(const HashedString& key) const;
-    };
-
 private:
     static constexpr uint LENGTH = 32 - sizeof (u8) - sizeof (u32);
     char data[LENGTH];
@@ -25,4 +21,4 @@ private:
     u32 hash;
 };
 
-#endif
+#endif

+ 25 - 1
common/utils/List.h

@@ -17,7 +17,7 @@ public:
         data[entries++] = t;
         return *this;
     }
-    
+
     List& clear() {
         entries = 0;
         return *this;
@@ -27,6 +27,10 @@ public:
         return entries;
     }
 
+    uint getCapacity() const {
+        return L;
+    }
+
     T& operator[](uint index) {
         return data[index];
     }
@@ -35,6 +39,26 @@ public:
         return data[index];
     }
 
+    const T* getData() {
+        return data;
+    }
+
+    T* begin() {
+        return data;
+    }
+
+    const T* begin() const {
+        return data;
+    }
+
+    T* end() {
+        return data + entries;
+    }
+
+    const T* end() const {
+        return data + entries;
+    }
+
 private:
     uint entries;
     T data[L];

+ 26 - 0
common/utils/Random.cpp

@@ -0,0 +1,26 @@
+#include <chrono>
+
+#include "common/utils/Random.h"
+
+Random::Random() : seed(std::chrono::steady_clock::now().time_since_epoch().count()) {
+}
+
+Random::Random(u64 seed) : seed(seed) {
+}
+
+u32 Random::next() {
+    return nextSeed() >> 24;
+}
+
+u32 Random::next(uint bound) {
+    return next() % bound;
+}
+
+float Random::nextFloat() {
+    return next() * (1.0f / (0xFFFFFF + 1.0f));
+}
+
+u64 Random::nextSeed() {
+    seed = (seed * 0x5DEECE66DL + 0xBL) & 0xFFFFFFFFFFFF;
+    return seed;
+}

+ 21 - 0
common/utils/Random.h

@@ -0,0 +1,21 @@
+#ifndef RANDOM_H
+#define RANDOM_H
+
+#include "common/utils/Types.h"
+
+class Random {
+public:
+    Random();
+    Random(u64 seed);
+
+    u32 next();
+    u32 next(uint bound);
+    float nextFloat();
+
+private:
+    u64 nextSeed();
+
+    u64 seed;
+};
+
+#endif

+ 2 - 2
meson.build

@@ -2,13 +2,13 @@ project('cubes plus plus', 'cpp')
 
 # 'common/world/Chunk.cpp', 'common/world/World.cpp', 'common/utils/Face.cpp'
 
-sourcesCommon = ['common/block/BlockBuilder.cpp', 'common/block/Block.cpp', 'common/block/BlockRegistry.cpp', 'common/utils/HashedString.cpp', 'common/stream/Stream.cpp', 'common/utils/DataVector.cpp', 'common/utils/String.cpp', 'common/utils/SplitString.cpp']
+sourcesCommon = ['common/block/BlockBuilder.cpp', 'common/block/Block.cpp', 'common/block/BlockRegistry.cpp', 'common/utils/HashedString.cpp', 'common/stream/Stream.cpp', 'common/utils/DataVector.cpp', 'common/utils/String.cpp', 'common/utils/SplitString.cpp', 'common/utils/Random.cpp']
 
 sourcesServer = ['server/Main.cpp', 'server/network/Server.cpp', 'server/GameServer.cpp', 'server/commands/ServerCommands.cpp', 'server/commands/CommandManager.cpp', 'server/network/Socket.cpp', 'server/commands/CommandEditor.cpp', 'server/Clock.cpp']
 
 sourcesClient = ['client/Main.cpp', 'client/rendering/WindowSize.cpp', 'client/math/Frustum.cpp', 'client/math/Ray.cpp', 'client/rendering/Framebuffers.cpp', 'client/rendering/wrapper/GLFWWrapper.cpp', 'client/rendering/wrapper/Window.cpp', 'client/rendering/Engine.cpp', 'client/input/Keys.cpp', 'client/rendering/wrapper/Shader.cpp', 'client/rendering/Shaders.cpp', 'client/utils/Utils.cpp', 'client/rendering/Mesh.cpp', 'client/math/Matrix.cpp', 'client/math/MatrixStack.cpp', 'client/math/Vector.cpp', 'client/math/Camera.cpp', 'client/math/Plane.cpp', 'client/Game.cpp', 'client/input/MouseButtons.cpp', 'client/rendering/FileTexture.cpp', 'client/rendering/FontRenderer.cpp', 'client/rendering/wrapper/Framebuffer.cpp', 'client/rendering/NoiseTexture.cpp', 'client/utils/Clock.cpp', 'client/input/Control.cpp', 'client/rendering/RenderSettings.cpp', 'client/rendering/wrapper/VertexBuffer.cpp', 'client/rendering/wrapper/StreamBuffer.cpp', 'client/rendering/wrapper/Texture.cpp', 'client/utils/PNGReader.cpp', 'client/rendering/wrapper/GLWrapper.cpp', 'client/rendering/Renderer.cpp']
 
-sourcesTest = ['tests/Main.cpp', 'common/utils/String.cpp', 'common/utils/SplitString.cpp', 'client/math/Matrix.cpp', 'client/math/Vector.cpp']
+sourcesTest = ['tests/Main.cpp', 'common/utils/String.cpp', 'common/utils/SplitString.cpp', 'client/math/Matrix.cpp', 'client/math/Vector.cpp', 'common/utils/HashedString.cpp', 'common/utils/Random.cpp']
 
 c_compiler = meson.get_compiler('cpp')
 readline = c_compiler.find_library('readline', required: true)

+ 1 - 1
server/GameServer.cpp

@@ -12,7 +12,7 @@ void GameServer::tick() {
 void GameServer::handleCommands(CommandEditor& editor, ServerCommands& serverCommands) {
     while(editor.hasCommand()) {
         String s = editor.readCommand();
-        CommandManager::execute(serverCommands, s);
+        commandManager.execute(serverCommands, s);
     }
 }
 

+ 2 - 0
server/GameServer.h

@@ -5,6 +5,7 @@
 #include "server/commands/ServerCommands.h"
 #include "common/stream/Stream.h"
 #include "server/Clock.h"
+#include "commands/CommandManager.h"
 
 class GameServer final {
 public:
@@ -20,6 +21,7 @@ public:
 
 private:
     const Clock& tps;
+    CommandManager commandManager;
 };
 
 #endif

+ 9 - 11
server/commands/CommandManager.cpp

@@ -1,9 +1,6 @@
 #include <iostream>
-#include <unordered_map>
 
 #include "server/commands/CommandManager.h"
-#include "common/utils/HashedString.h"
-#include "common/utils/SplitString.h"
 
 static void commandTest(ServerCommands&, const SplitString& args) {
     std::cout << "test command" << std::endl;
@@ -16,12 +13,13 @@ static void commandStop(ServerCommands& sc, const SplitString&) {
     sc.stop();
 }
 
-typedef void (*Command) (ServerCommands&, const SplitString&);
+static void commandEmpty(ServerCommands&, const SplitString&) {
+}
 
-static std::unordered_map<HashedString, Command, HashedString::Hasher> commands( {
-    {"test", commandTest},
-    {"stop", commandStop}
-});
+CommandManager::CommandManager() : commands("", commandEmpty) {
+    commands.add("test", commandTest);
+    commands.add("stop", commandStop);
+}
 
 void CommandManager::execute(ServerCommands& sc, const String& rawCommand) {
     SplitString args(rawCommand);
@@ -31,10 +29,10 @@ void CommandManager::execute(ServerCommands& sc, const String& rawCommand) {
     }
 
     HashedString command(args[0]);
-    auto iter = commands.find(command);
-    if(iter == commands.end()) {
+    Command c = commands.search(command);
+    if(c == commandEmpty) {
         std::cout << "Unknown command: '" << command << "'" << std::endl;
         return;
     }
-    iter->second(sc, args);
+    c(sc, args);
 }

+ 13 - 2
server/commands/CommandManager.h

@@ -3,9 +3,20 @@
 
 #include "server/commands/ServerCommands.h"
 #include "common/utils/String.h"
+#include "common/utils/SplitString.h"
+#include "common/utils/HashMap.h"
+#include "common/utils/HashedString.h"
+
+class CommandManager {
+public:
+    CommandManager();
 
-namespace CommandManager {
     void execute(ServerCommands& sc, const String& rawCommand);
-}
+    
+private:
+    typedef void (*Command) (ServerCommands&, const SplitString&);
+
+    HashMap<HashedString, Command, 16> commands;
+};
 
 #endif

+ 0 - 1
server/network/Server.cpp

@@ -1,6 +1,5 @@
 #include <iostream>
 #include <cstring>
-#include <vector>
 #include <thread>
 #include <mutex>
 

+ 4 - 9
tests/Main.cpp

@@ -1,11 +1,13 @@
 #include <iostream>
-#include <array>
 
 #include "common/utils/SplitString.h"
+#include "common/utils/Array.h"
+#include "common/utils/HashMap.h"
 #include "common/utils/List.h"
 #include "client/math/Vector.h"
 #include "client/math/Matrix.h"
-#include <limits.h>
+#include "common/utils/HashedString.h"
+#include "common/utils/Random.h"
 
 typedef List<const char*, 16> StringList;
 
@@ -93,12 +95,5 @@ long getNanos() {
 
 int main() {
     //testCommandParser();
-    //Matrix m;
-    
-    float f;
-    long* l = (long*) (&f);
-    *l = 1016003125;
-    std::cout << f << "\n";
-
     return 0;
 }