[shaders|textures] Moved into 'resources' folder. [Types->IntTypes] Renamed.

This commit is contained in:
Quentin Bazin 2018-06-25 18:42:50 +02:00
parent 6fdf1fc81d
commit 3a62fdc598
41 changed files with 33 additions and 37 deletions

2
TODO
View File

@ -10,7 +10,7 @@ TODO
◦ DONE: `Debug` / `Exception` ◦ DONE: `Debug` / `Exception`
◦ TODO: `Window` et `Texture` (depuis `ZeldaOOL`) ◦ TODO: `Window` et `Texture` (depuis `ZeldaOOL`)
◦ TODO: Input system (Mouse + Keyboard) ◦ TODO: Input system (Mouse + Keyboard)
TODO: `Types.hpp` → `IntTypes.hpp` • DONE: `Types.hpp` → `IntTypes.hpp`
→ TODO: Vérifier que les types sont bien corrects → TODO: Vérifier que les types sont bien corrects
• TODO: Vérifier les utilisations inutiles de pointeurs • TODO: Vérifier les utilisations inutiles de pointeurs
• TODO: Catch SDLLoader exception • TODO: Catch SDLLoader exception

View File

@ -14,7 +14,7 @@
#ifndef COLOR_HPP_ #ifndef COLOR_HPP_
#define COLOR_HPP_ #define COLOR_HPP_
#include "Types.hpp" #include "IntTypes.hpp"
class Color { class Color {
public: public:

View File

@ -1,7 +1,7 @@
/* /*
* ===================================================================================== * =====================================================================================
* *
* Filename: Types.hpp * Filename: IntTypes.hpp
* *
* Description: * Description:
* *
@ -11,8 +11,8 @@
* *
* ===================================================================================== * =====================================================================================
*/ */
#ifndef TYPES_HPP_ #ifndef INTTYPES_HPP_
#define TYPES_HPP_ #define INTTYPES_HPP_
typedef unsigned char u8; typedef unsigned char u8;
typedef signed char s8; typedef signed char s8;
@ -21,4 +21,4 @@ typedef signed short s16;
typedef unsigned long u32; typedef unsigned long u32;
typedef signed long s32; typedef signed long s32;
#endif // TYPES_HPP_ #endif // INTTYPES_HPP_

View File

@ -16,7 +16,7 @@
#include <map> #include <map>
#include "Types.hpp" #include "IntTypes.hpp"
class Keyboard { class Keyboard {
public: public:

View File

@ -14,7 +14,7 @@
#ifndef MOUSE_HPP_ #ifndef MOUSE_HPP_
#define MOUSE_HPP_ #define MOUSE_HPP_
#include "Types.hpp" #include "IntTypes.hpp"
#include "Window.hpp" #include "Window.hpp"
class Mouse { class Mouse {

View File

@ -14,7 +14,7 @@
#ifndef TIMER_HPP_ #ifndef TIMER_HPP_
#define TIMER_HPP_ #define TIMER_HPP_
#include "Types.hpp" #include "IntTypes.hpp"
class Timer { class Timer {
public: public:

View File

@ -17,7 +17,7 @@
#include <stdexcept> #include <stdexcept>
#include <utility> #include <utility>
#include "Types.hpp" #include "IntTypes.hpp"
template<typename T> template<typename T>
class Vector2 { class Vector2 {

View File

@ -17,9 +17,9 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include "IntTypes.hpp"
#include "RenderTarget.hpp" #include "RenderTarget.hpp"
#include "SDLHeaders.hpp" #include "SDLHeaders.hpp"
#include "Types.hpp"
class Window : public RenderTarget { class Window : public RenderTarget {
public: public:

View File

@ -16,9 +16,9 @@
#include <string> #include <string>
#include "IntTypes.hpp"
#include "NonCopyable.hpp" #include "NonCopyable.hpp"
#include "OpenGL.hpp" #include "OpenGL.hpp"
#include "Types.hpp"
class Texture : public NonCopyable { class Texture : public NonCopyable {
public: public:

View File

@ -14,8 +14,6 @@
#ifndef BLOCKTYPE_HPP_ #ifndef BLOCKTYPE_HPP_
#define BLOCKTYPE_HPP_ #define BLOCKTYPE_HPP_
#include "Types.hpp"
namespace BlockType { namespace BlockType {
enum { enum {
Air = 0, Air = 0,

View File

@ -17,7 +17,6 @@
#include <vector> #include <vector>
#include "ItemStack.hpp" #include "ItemStack.hpp"
#include "Types.hpp"
class Inventory { class Inventory {
public: public:

View File

@ -14,6 +14,7 @@
#ifndef ITEM_HPP_ #ifndef ITEM_HPP_
#define ITEM_HPP_ #define ITEM_HPP_
#include "IntTypes.hpp"
#include "ItemType.hpp" #include "ItemType.hpp"
class Item { class Item {

View File

@ -14,8 +14,6 @@
#ifndef ITEMTYPE_HPP_ #ifndef ITEMTYPE_HPP_
#define ITEMTYPE_HPP_ #define ITEMTYPE_HPP_
#include "Types.hpp"
namespace ItemType { namespace ItemType {
enum { enum {
Air = 0, Air = 0,

View File

@ -20,7 +20,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "Types.hpp" #include "IntTypes.hpp"
#define DEBUG_ENABLED #define DEBUG_ENABLED
#define DEBUG_COLOR #define DEBUG_COLOR

View File

@ -18,7 +18,6 @@
#include <string> #include <string>
#include "Debug.hpp" #include "Debug.hpp"
#include "Types.hpp"
#define EXCEPTION(args...) (Exception(__LINE__, _FILE, args)) #define EXCEPTION(args...) (Exception(__LINE__, _FILE, args))

View File

@ -16,7 +16,7 @@
#include <functional> #include <functional>
#include "Types.hpp" #include "IntTypes.hpp"
class GameClock { class GameClock {
public: public:

View File

@ -17,6 +17,7 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include "BlockType.hpp" #include "BlockType.hpp"
#include "IntTypes.hpp"
class Chunk; class Chunk;
class World; class World;

View File

@ -16,8 +16,8 @@
#include <vector> #include <vector>
#include "IntTypes.hpp"
#include "Vertex.hpp" #include "Vertex.hpp"
#include "Types.hpp"
class Block; class Block;
class Chunk; class Chunk;

View File

@ -17,7 +17,7 @@
#include <queue> #include <queue>
#include "Config.hpp" #include "Config.hpp"
#include "Types.hpp" #include "IntTypes.hpp"
struct LightNode { struct LightNode {
LightNode(int _x, int _y, int _z) : x(_x), y(_y), z(_z) {} LightNode(int _x, int _y, int _z) : x(_x), y(_y), z(_z) {}

View File

@ -1,8 +1,8 @@
<textures> <textures>
<texture name="block_destroy" path="textures/block_destroy.png" /> <texture name="block_destroy" path="resources/textures/block_destroy.png" />
<texture name="blocks" path="textures/blocks.png" /> <texture name="blocks" path="resources/textures/blocks.png" />
<texture name="font" path="textures/font.png" /> <texture name="font" path="resources/textures/font.png" />
<texture name="items" path="textures/items.png" /> <texture name="items" path="resources/textures/items.png" />
<texture name="widgets" path="textures/widgets.png" /> <texture name="widgets" path="resources/textures/widgets.png" />
<texture name="workbench" path="textures/workbench.png" /> <texture name="workbench" path="resources/textures/workbench.png" />
</textures> </textures>

View File

Before

Width:  |  Height:  |  Size: 641 B

After

Width:  |  Height:  |  Size: 641 B

View File

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 174 KiB

View File

Before

Width:  |  Height:  |  Size: 822 B

After

Width:  |  Height:  |  Size: 822 B

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

View File

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 192 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -20,8 +20,8 @@ static const auto backgroundY = SCREEN_HEIGHT - 22 * 3;
Hotbar::Hotbar(Inventory &inventory) : m_inventory(inventory) { Hotbar::Hotbar(Inventory &inventory) : m_inventory(inventory) {
m_shader.createProgram(); m_shader.createProgram();
m_shader.addShader(GL_VERTEX_SHADER, "shaders/basic.v.glsl"); m_shader.addShader(GL_VERTEX_SHADER, "resources/shaders/basic.v.glsl");
m_shader.addShader(GL_FRAGMENT_SHADER, "shaders/basic.f.glsl"); m_shader.addShader(GL_FRAGMENT_SHADER, "resources/shaders/basic.f.glsl");
m_shader.linkProgram(); m_shader.linkProgram();
m_background.load("texture-widgets"); m_background.load("texture-widgets");

View File

@ -83,11 +83,11 @@ void GameState::update() {
void GameState::initShaders() { void GameState::initShaders() {
m_shader.createProgram(); m_shader.createProgram();
m_shader.addShader(GL_VERTEX_SHADER, "shaders/game.v.glsl"); m_shader.addShader(GL_VERTEX_SHADER, "resources/shaders/game.v.glsl");
m_shader.addShader(GL_FRAGMENT_SHADER, "shaders/color.f.glsl"); m_shader.addShader(GL_FRAGMENT_SHADER, "resources/shaders/color.f.glsl");
m_shader.addShader(GL_FRAGMENT_SHADER, "shaders/light.f.glsl"); m_shader.addShader(GL_FRAGMENT_SHADER, "resources/shaders/light.f.glsl");
m_shader.addShader(GL_FRAGMENT_SHADER, "shaders/fog.f.glsl"); m_shader.addShader(GL_FRAGMENT_SHADER, "resources/shaders/fog.f.glsl");
m_shader.addShader(GL_FRAGMENT_SHADER, "shaders/game.f.glsl"); m_shader.addShader(GL_FRAGMENT_SHADER, "resources/shaders/game.f.glsl");
m_shader.linkProgram(); m_shader.linkProgram();
} }

View File

@ -19,8 +19,8 @@ InventoryState::InventoryState(Inventory &playerInventory, Inventory &hotbarInve
: ApplicationState(parent), m_playerInventory{playerInventory}, m_hotbarInventory{hotbarInventory} : ApplicationState(parent), m_playerInventory{playerInventory}, m_hotbarInventory{hotbarInventory}
{ {
m_shader.createProgram(); m_shader.createProgram();
m_shader.addShader(GL_VERTEX_SHADER, "shaders/basic.v.glsl"); m_shader.addShader(GL_VERTEX_SHADER, "resources/shaders/basic.v.glsl");
m_shader.addShader(GL_FRAGMENT_SHADER, "shaders/basic.f.glsl"); m_shader.addShader(GL_FRAGMENT_SHADER, "resources/shaders/basic.f.glsl");
m_shader.linkProgram(); m_shader.linkProgram();
Mouse::setCursorGrabbed(false); Mouse::setCursorGrabbed(false);