-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor, namespaces and day night cycle
- Loading branch information
Showing
85 changed files
with
2,148 additions
and
1,998 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
#include "renderer/models/Model.h" | ||
|
||
namespace Jukcraft { | ||
class Block { | ||
public: | ||
Block(const char*, BlockID id, const Model& model, const std::vector<uint8_t>& textures, bool transparent, uint8_t light) | ||
:id(id), model(model), textures(textures), transparent(transparent), light(light) { | ||
CHECK(textures.size() == model.getQuads().size(), "Texture layout does not match model"); | ||
} | ||
bool isCube() const { | ||
return model.getQuads().size() == 6; | ||
} | ||
constexpr const Model& getModel() const { | ||
return model; | ||
} | ||
constexpr const std::vector<uint8_t>& getTextureLayout() const { | ||
return textures; | ||
} | ||
constexpr bool isTransparent() const { | ||
return transparent; | ||
} | ||
constexpr uint8_t getLight() const { | ||
return light; | ||
} | ||
private: | ||
BlockID id; | ||
const Model& model; | ||
std::vector<uint8_t> textures; | ||
bool transparent; | ||
uint8_t light; | ||
}; | ||
} |
Oops, something went wrong.