[shaders|textures] Moved into 'resources' folder. [Types->IntTypes] Renamed.
2
TODO
@ -10,7 +10,7 @@ TODO
|
||||
◦ DONE: `Debug` / `Exception`
|
||||
◦ TODO: `Window` et `Texture` (depuis `ZeldaOOL`)
|
||||
◦ 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 les utilisations inutiles de pointeurs
|
||||
• TODO: Catch SDLLoader exception
|
||||
|
@ -14,7 +14,7 @@
|
||||
#ifndef COLOR_HPP_
|
||||
#define COLOR_HPP_
|
||||
|
||||
#include "Types.hpp"
|
||||
#include "IntTypes.hpp"
|
||||
|
||||
class Color {
|
||||
public:
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* =====================================================================================
|
||||
*
|
||||
* Filename: Types.hpp
|
||||
* Filename: IntTypes.hpp
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
@ -11,8 +11,8 @@
|
||||
*
|
||||
* =====================================================================================
|
||||
*/
|
||||
#ifndef TYPES_HPP_
|
||||
#define TYPES_HPP_
|
||||
#ifndef INTTYPES_HPP_
|
||||
#define INTTYPES_HPP_
|
||||
|
||||
typedef unsigned char u8;
|
||||
typedef signed char s8;
|
||||
@ -21,4 +21,4 @@ typedef signed short s16;
|
||||
typedef unsigned long u32;
|
||||
typedef signed long s32;
|
||||
|
||||
#endif // TYPES_HPP_
|
||||
#endif // INTTYPES_HPP_
|
@ -16,7 +16,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "Types.hpp"
|
||||
#include "IntTypes.hpp"
|
||||
|
||||
class Keyboard {
|
||||
public:
|
||||
|
@ -14,7 +14,7 @@
|
||||
#ifndef MOUSE_HPP_
|
||||
#define MOUSE_HPP_
|
||||
|
||||
#include "Types.hpp"
|
||||
#include "IntTypes.hpp"
|
||||
#include "Window.hpp"
|
||||
|
||||
class Mouse {
|
||||
|
@ -14,7 +14,7 @@
|
||||
#ifndef TIMER_HPP_
|
||||
#define TIMER_HPP_
|
||||
|
||||
#include "Types.hpp"
|
||||
#include "IntTypes.hpp"
|
||||
|
||||
class Timer {
|
||||
public:
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
|
||||
#include "Types.hpp"
|
||||
#include "IntTypes.hpp"
|
||||
|
||||
template<typename T>
|
||||
class Vector2 {
|
||||
|
@ -17,9 +17,9 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "IntTypes.hpp"
|
||||
#include "RenderTarget.hpp"
|
||||
#include "SDLHeaders.hpp"
|
||||
#include "Types.hpp"
|
||||
|
||||
class Window : public RenderTarget {
|
||||
public:
|
||||
|
@ -16,9 +16,9 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "IntTypes.hpp"
|
||||
#include "NonCopyable.hpp"
|
||||
#include "OpenGL.hpp"
|
||||
#include "Types.hpp"
|
||||
|
||||
class Texture : public NonCopyable {
|
||||
public:
|
||||
|
@ -14,8 +14,6 @@
|
||||
#ifndef BLOCKTYPE_HPP_
|
||||
#define BLOCKTYPE_HPP_
|
||||
|
||||
#include "Types.hpp"
|
||||
|
||||
namespace BlockType {
|
||||
enum {
|
||||
Air = 0,
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include <vector>
|
||||
|
||||
#include "ItemStack.hpp"
|
||||
#include "Types.hpp"
|
||||
|
||||
class Inventory {
|
||||
public:
|
||||
|
@ -14,6 +14,7 @@
|
||||
#ifndef ITEM_HPP_
|
||||
#define ITEM_HPP_
|
||||
|
||||
#include "IntTypes.hpp"
|
||||
#include "ItemType.hpp"
|
||||
|
||||
class Item {
|
||||
|
@ -14,8 +14,6 @@
|
||||
#ifndef ITEMTYPE_HPP_
|
||||
#define ITEMTYPE_HPP_
|
||||
|
||||
#include "Types.hpp"
|
||||
|
||||
namespace ItemType {
|
||||
enum {
|
||||
Air = 0,
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "Types.hpp"
|
||||
#include "IntTypes.hpp"
|
||||
|
||||
#define DEBUG_ENABLED
|
||||
#define DEBUG_COLOR
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include <string>
|
||||
|
||||
#include "Debug.hpp"
|
||||
#include "Types.hpp"
|
||||
|
||||
#define EXCEPTION(args...) (Exception(__LINE__, _FILE, args))
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "Types.hpp"
|
||||
#include "IntTypes.hpp"
|
||||
|
||||
class GameClock {
|
||||
public:
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "BlockType.hpp"
|
||||
#include "IntTypes.hpp"
|
||||
|
||||
class Chunk;
|
||||
class World;
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "IntTypes.hpp"
|
||||
#include "Vertex.hpp"
|
||||
#include "Types.hpp"
|
||||
|
||||
class Block;
|
||||
class Chunk;
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <queue>
|
||||
|
||||
#include "Config.hpp"
|
||||
#include "Types.hpp"
|
||||
#include "IntTypes.hpp"
|
||||
|
||||
struct LightNode {
|
||||
LightNode(int _x, int _y, int _z) : x(_x), y(_y), z(_z) {}
|
||||
|
@ -1,8 +1,8 @@
|
||||
<textures>
|
||||
<texture name="block_destroy" path="textures/block_destroy.png" />
|
||||
<texture name="blocks" path="textures/blocks.png" />
|
||||
<texture name="font" path="textures/font.png" />
|
||||
<texture name="items" path="textures/items.png" />
|
||||
<texture name="widgets" path="textures/widgets.png" />
|
||||
<texture name="workbench" path="textures/workbench.png" />
|
||||
<texture name="block_destroy" path="resources/textures/block_destroy.png" />
|
||||
<texture name="blocks" path="resources/textures/blocks.png" />
|
||||
<texture name="font" path="resources/textures/font.png" />
|
||||
<texture name="items" path="resources/textures/items.png" />
|
||||
<texture name="widgets" path="resources/textures/widgets.png" />
|
||||
<texture name="workbench" path="resources/textures/workbench.png" />
|
||||
</textures>
|
||||
|
Before Width: | Height: | Size: 641 B After Width: | Height: | Size: 641 B |
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 174 KiB |
Before Width: | Height: | Size: 822 B After Width: | Height: | Size: 822 B |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
BIN
resources/textures/recipe.png
Normal file
After Width: | Height: | Size: 852 B |
Before Width: | Height: | Size: 192 KiB After Width: | Height: | Size: 192 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
@ -20,8 +20,8 @@ static const auto backgroundY = SCREEN_HEIGHT - 22 * 3;
|
||||
|
||||
Hotbar::Hotbar(Inventory &inventory) : m_inventory(inventory) {
|
||||
m_shader.createProgram();
|
||||
m_shader.addShader(GL_VERTEX_SHADER, "shaders/basic.v.glsl");
|
||||
m_shader.addShader(GL_FRAGMENT_SHADER, "shaders/basic.f.glsl");
|
||||
m_shader.addShader(GL_VERTEX_SHADER, "resources/shaders/basic.v.glsl");
|
||||
m_shader.addShader(GL_FRAGMENT_SHADER, "resources/shaders/basic.f.glsl");
|
||||
m_shader.linkProgram();
|
||||
|
||||
m_background.load("texture-widgets");
|
||||
|
@ -83,11 +83,11 @@ void GameState::update() {
|
||||
void GameState::initShaders() {
|
||||
m_shader.createProgram();
|
||||
|
||||
m_shader.addShader(GL_VERTEX_SHADER, "shaders/game.v.glsl");
|
||||
m_shader.addShader(GL_FRAGMENT_SHADER, "shaders/color.f.glsl");
|
||||
m_shader.addShader(GL_FRAGMENT_SHADER, "shaders/light.f.glsl");
|
||||
m_shader.addShader(GL_FRAGMENT_SHADER, "shaders/fog.f.glsl");
|
||||
m_shader.addShader(GL_FRAGMENT_SHADER, "shaders/game.f.glsl");
|
||||
m_shader.addShader(GL_VERTEX_SHADER, "resources/shaders/game.v.glsl");
|
||||
m_shader.addShader(GL_FRAGMENT_SHADER, "resources/shaders/color.f.glsl");
|
||||
m_shader.addShader(GL_FRAGMENT_SHADER, "resources/shaders/light.f.glsl");
|
||||
m_shader.addShader(GL_FRAGMENT_SHADER, "resources/shaders/fog.f.glsl");
|
||||
m_shader.addShader(GL_FRAGMENT_SHADER, "resources/shaders/game.f.glsl");
|
||||
|
||||
m_shader.linkProgram();
|
||||
}
|
||||
|
@ -19,8 +19,8 @@ InventoryState::InventoryState(Inventory &playerInventory, Inventory &hotbarInve
|
||||
: ApplicationState(parent), m_playerInventory{playerInventory}, m_hotbarInventory{hotbarInventory}
|
||||
{
|
||||
m_shader.createProgram();
|
||||
m_shader.addShader(GL_VERTEX_SHADER, "shaders/basic.v.glsl");
|
||||
m_shader.addShader(GL_FRAGMENT_SHADER, "shaders/basic.f.glsl");
|
||||
m_shader.addShader(GL_VERTEX_SHADER, "resources/shaders/basic.v.glsl");
|
||||
m_shader.addShader(GL_FRAGMENT_SHADER, "resources/shaders/basic.f.glsl");
|
||||
m_shader.linkProgram();
|
||||
|
||||
Mouse::setCursorGrabbed(false);
|
||||
|