Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ before_install:
- export CXX="g++-6" CC="gcc-6"

before_script:
- sudo apt-get install -y libudev-dev libjpeg62-dev libsndfile1-dev libglew1.5 libglew1.5-dev libfreetype6 libjpeg-turbo8 libjpeg8 libopenal-data libopenal1 libopenal-dev libxrandr2 libxrender1 libsoil1

script: mkdir build && cd build && cmake .. && make
- sudo apt-get install -y libudev-dev libjpeg62-dev libsndfile1-dev libglew1.5 libglew1.5-dev libfreetype6 libjpeg-turbo8 libjpeg8 libopenal-data libopenal1 libopenal-dev libxrandr2 libxrender1 libsoil1 xorg-dev libglu1-mesa-dev
script: mkdir build && cd build && cmake .. && make
2 changes: 1 addition & 1 deletion deps/Lua/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 2.6)

cmake_policy(SET CMP0015 NEW)
project (lua) # project here actually means solution in premake

if(WIN32)
Expand Down
6 changes: 3 additions & 3 deletions src/app/Application.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Application.h"
#include "Application.h"

#include "states/StateMenu.h"
#include "states/StatePlaying.h"
Expand Down Expand Up @@ -79,7 +79,7 @@ void Application::start()
updates++;
upTimer += UP_TICK;
m_states.back()->update(timestep);
for (int32 i = m_panels.size() - 1; i >= 0; i--)
for (int32 i = static_cast<int32>(m_panels.size()) - 1; i >= 0; i--)
m_panels[i]->update();
}

Expand Down Expand Up @@ -124,7 +124,7 @@ void Application::render()

sf::View oldView = m_window.getView();
m_window.setView(m_uiView);
for (int32 i = m_panels.size() - 1; i >= 0; i--)
for (int32 i = static_cast<int32>(m_panels.size()) - 1; i >= 0; i--)
m_panels[i]->render(m_window);
m_fpsLabel->render(m_window);

Expand Down
6 changes: 3 additions & 3 deletions src/entity/AStar.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once
#pragma once

#include "../Common.h"

Expand Down Expand Up @@ -63,7 +63,7 @@ namespace std
auto h1 = hasher(std::get<0>(pos));
auto h2 = hasher(std::get<1>(pos));

return std::hash<int>{}((h1 ^ h2) >> 2);
return std::hash<int>{}((static_cast<int>(h1 ^ h2)) >> 2);
}
};
}
}
2 changes: 1 addition & 1 deletion src/entity/Entity.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once
#pragma once

#include "../components/Component.h"

Expand Down
7 changes: 5 additions & 2 deletions src/graphics/Renderer2D.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Renderer2D.h"
#include "Renderer2D.h"

#include "../maths/maths.h"
#include "../maths/Color.h"
Expand All @@ -8,7 +8,10 @@ namespace Graphics
Renderer2D::Renderer2D()
{
m_before.buffer = new sf::Vertex[MAX_VERTICES];
m_before.vertexCount = 0;

m_after.buffer = new sf::Vertex[MAX_VERTICES];
m_after.vertexCount = 0;
}

Renderer2D::~Renderer2D()
Expand Down Expand Up @@ -76,4 +79,4 @@ namespace Graphics

render.vertexCount += 4;
}
}
}
12 changes: 6 additions & 6 deletions src/level/gen/WorldGenerator.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "WorldGenerator.h"
#include "WorldGenerator.h"
#include "../../util/FileUtil.h"

namespace WGenerator
Expand All @@ -11,8 +11,8 @@ namespace WGenerator

if (! (mainJSON["seed"] == "random")) m_generator.setSeed(mainJSON["seed"]);

for (int i=0; i < mainJSON["width"]; i++) {
for (int j=0; j<mainJSON["height"]; j++) {
for (int i=0; i < static_cast<int>(mainJSON["width"]); i++) {
for (int j=0; j < static_cast<int>(mainJSON["height"]); j++) {
addList.push_back({i, j, mainJSON["defaultWall"], 0});
}
}
Expand All @@ -32,7 +32,7 @@ namespace WGenerator
if (!m_leafs[i]->leftChild && !m_leafs[i]->rightChild)
{
int randomizedValue = m_generator.intInRange(0, 100);
if (m_leafs[i]->block.width > mainJSON["maxLeafSize"] || m_leafs[i]->block.height > mainJSON["maxLeafSize"] ||
if (m_leafs[i]->block.width > static_cast<int32>(mainJSON["maxLeafSize"]) || m_leafs[i]->block.height > static_cast<int32>(mainJSON["maxLeafSize"]) ||
randomizedValue > 25)
{
if (m_leafs[i]->split())
Expand Down Expand Up @@ -113,7 +113,7 @@ namespace WGenerator
data.push_back(std::make_pair<std::vector<std::shared_ptr<IntRectangle>>, byte>(getHalls(), mainJSON["defaultFloor"]));
renderRooms();
render(data);
uint numberOfRooms = getRooms().size();
uint numberOfRooms = static_cast<uint>(getRooms().size());
map.addList = addList;
map.playerPosition = placePlayer(static_cast<uint>(m_generator.uint64InRange(0, numberOfRooms)));
return map;
Expand Down Expand Up @@ -147,7 +147,7 @@ namespace WGenerator
uint i=0;
while (true){
if (i >= random.size()) break;
if (random.at(i)["chance"] > x) {
if (static_cast<uint>(random.at(i)["chance"]) > x) {
renderRoom(*rooms[roomIterator], random[i]);
break;
}
Expand Down
6 changes: 3 additions & 3 deletions src/level/tile/TileMap.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "TileMap.h"
#include "TileMap.h"

#include "TileDatabase.h"

Expand Down Expand Up @@ -114,8 +114,8 @@ namespace Level

// --
// Do not render tiles that can not be seen (dark)
int32 xa = x - 1 <= 0 ? 1 : x - 1, xb = x + 1 >= height ? height - 1 : x + 1;
int32 ya = y - 1 <= 0 ? 1 : y - 1, yb = y + 1 >= height ? height - 1 : y + 1;
int32 xa = x - 1 <= 0 ? 1 : x - 1, xb = x + 1 >= (int32)height ? height - 1 : x + 1;
int32 ya = y - 1 <= 0 ? 1 : y - 1, yb = y + 1 >= (int32)height ? height - 1 : y + 1;

if (layer->tiles[xa][ya]->light.color == Color::Black && layer->tiles[xb][yb]->light.color == Color::Black
&& layer->tiles[xa][yb]->light.color == Color::Black && layer->tiles[xb][ya]->light.color == Color::Black)
Expand Down
6 changes: 3 additions & 3 deletions src/util/Log.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once
#pragma once

#include "../Common.h"

Expand Down Expand Up @@ -107,7 +107,7 @@ namespace Log
inline void print_log_internal(char* buffer, int32& position, First&& first)
{
const char* formatted = Log::to_string<First>(first);
int32 length = strlen(formatted);
int32 length = static_cast<int32>(strlen(formatted));
memcpy(&buffer[position], formatted, length);
position += length;
}
Expand All @@ -116,7 +116,7 @@ namespace Log
inline void print_log_internal(char* buffer, int32& position, First&& first, Args&&... args)
{
const char* formatted = Log::to_string<First>(first);
int32 length = strlen(formatted);
int32 length = static_cast<int32>(strlen(formatted));
memcpy(&buffer[position], formatted, length);
position += length;
if (sizeof...(Args))
Expand Down